Your yes_no_total field is not a columnar total, it’s still an aggregation that totals the value per row. Instead choose one of the predefined calculations to get this result - % of column:
@Dawid Thank you for your suggestion. Unfortunately this solution does not work once I added one more question_name. I need to show percentage from total amount of answers per question_name. Like this:
sec2_5
Yes
16170
57%
sec2_5
No
12233
43%
sec2_6
Yes
22297
77%
sec2_6
No
6097
21%
But received this instead:
Is there any way to have result aggregated per question_name?
In this case you won’t be able to do it using LookML or table calculations becaue essentially what you need is a windowed sum partitioned by your question name. Window functions is something we can’t use. You can only achieve this by creating partitioned metrics in your data model or in a derived table:
Here’s the explanataion why window functions don’t work. Basically dimensions are always in the GROUP BY clause. We’ve asked Looker long time ago to allow us to do that because it’s as simple as a parameter that would specify a dimension that is outside of the group by clause..
Here are two product ideas that could be upvoted to gain more traction:
I’ve found not being able to use windowing functions directly in Looker a big drawback. Not a deal breaker, but not far away from it. I’m surprised it hasn’t been addressed.