Struggling creating a Temp Table

I am trying to basically accomplish the following:

  • I have a single table that contains a companyName, Opt-In(Boolean column), Thanks(boolean)
  • I would like to calculate a percentage of Opt-ins to Thanks, then grouped by company name…
  • I was thinking i would create a temp table, and then iterate thru each name and caluclate the %, but i do not know how to accomplish within metabase\postgresql…

Any tips would be helpful

Hi @Huntehhh
You should be able to do it with Custom Expressions that are new in 0.35:
https://www.metabase.com/docs/latest/users-guide/expressions.html
With something like CountIf([Opt-It] = 1) / CountIf([Thanks] = 1)
If you’re looking to do it with SQL, then you’ll likely find better help in a Postgres specific forum or stackoverflow.com, since it’s not specific to Metabase at all.