Concatenate a measure and a table calculation as custom field

I am a complete newbie to Looker (I have been using it for less than week so kindly pardon my ignorance) . I am trying to create a custom field for a visualization by combining a measure and a table calculation. For instance if number of Installs is a dimension and percent of total installs is a table calculation (for ex. # Installs = 9000 and Percent Of Total Installs = 17%) the custom filed (data label) should be displayed as 9000 17% . I am trying to accomplish a basic SQL Concatenation here just for displaying the data label in this format (no calculation involved between the dimension Installs and Table Calculation Percent of Total Installs). Can someone please help? Format would be like ({number} ({percentage}%) .
Thanks!

0 1 2,194
1 REPLY 1

Is your custom field a measure, dimension or table calculation? By your statement, I’m assuming it’s a measure, or maybe a dimension. LookML can’t access table calculations. So, you can solve this problem 2 different ways.

  1. Add another table calculation that references the first. This is what I think you want to do. You can use the concat function in your calculation. This webinar: https://training.looker.com/series/recorded-webinars/table-calculations-tips-and-tricks. has many examples of one one calclation referencing another.

  2. Add a measure to your view which does what the calculation does and concatenates the measure. It might look like this in your view:

measure: existing_measure{}
measure: new_measure{
type: string
sql: ‘your magical calculation’ || ${existing measure}

Top Labels in this Space