Solved

Grouping rows

  • 15 September 2022
  • 4 replies
  • 652 views

Hello,

I’m reaching out for some help on how to aggregate rows in order to correctly display them in a chart. I was able to group Teams 6A, 6B and 6C into Team 6 but need some help aggregating the three “Team 6” rows, any help is welcome. I have used “if(contains(...”  on my initial calculation.
 


Thanks in advance,
Richard

icon

Best answer by Dawid 14 October 2022, 12:49

View original

This topic has been closed for comments

4 replies

Userlevel 7
Badge +1

You have to remove “ALL TEAMS” field as this is the granularity of your data.

Hi @Dawid, thanks for your reply.

The “ALL TEAMS” field is my data source and I have it marked as “Hide from visualization”. However, if I remove it entirely from my data table, my calculation for “TEAMS” returns an error with the following message “Field "ALL TEAMS" either does not exist in the current query or is a measure.”

if( contains (${ALL TEAMS}, "6" ) , "TEAM 6", ${ALL TEAMS} )

Thanks

Hi @Dawid , following up on my previous question to see if you can assist. Thanks 👍

Userlevel 7
Badge +1

You can’t group data by your derived field if you have a lower granularity field present in your query. You’d have to create your grouping in LookML not using table calculations