how to sum more than one dimension at looker?

HI,

I need to SUM more than one dimension in a looker view. How can I do that?

f18b245d-f494-4ec4-9806-6f8dcad646dc.png

I need to create a measure who is the sum of these three dimensions

0 2 5,538
2 REPLIES 2

minerkt
Participant IV

Hi @Bruna1 ,

If you are putting this value on a report, adding a table calculation is possible.

Just add a table calculation under the custom fields tab when building a report.

1f0eda89-cbfc-440c-8f74-d9dd54165ce6.png

 Then insert the fields you want to sum like so.

8fd2c8fe-6808-46a7-b91d-d2c514ab0892.png

Hope this helps!

leobardor
Participant V

Hi Bruna,

One way to achieve a sum of dimensions is by using looker - Table calculations .

The prerequisites of the dimensions is : all dimensions that are included in the sum must contain 

type:number .

For instance:

 dimension: training_duration_two {
type: number
sql: ${TABLE}.training_duration_two ;;
}

dimension: training_duration_two_minutes {
type: number
sql: CAST(trim(${TABLE}.training_duration_two) AS INTEGER) ;;
}
dimension: training_duration_three {
type: number
sql: ${TABLE}.training_duration_three ;;
}

After saving lookML changes, you need to add the table calculation needed:

0f837442-018e-4b30-9ae3-a623780c322d.png

The following menu will appear, in this box the sum is created by indicating the dimensions you want to sum:

57c9f063-c32c-4c80-aa3f-b0e4c028af97.png

After creating the new table calculation, the output will create a green column (green color column indicates that it is a table calculation column)

1292a6fd-a461-4bb8-b91b-e7174f2598a5.png

Regards,

Leo