hi, I’ve tried to find the answer in documentatio...
# gd-beginners
j
hi, I’ve tried to find the answer in documentation but just can’t get my head around how to make MAQL do what I want. see thread
1
image.png
Heat map visuals don’t appear to have a show as % option so I’m left with numbers. I would much rather show percentages so I want to figure out how to use MAQL to create my own perc_of_total metric that can be dropped into this visual. How am I supposed to create the denominator part where it sums the total regardless of the ‘day of week’ and ‘time of day’ variables that are used in the visual?
If there is an MAQL course that covers this please point me at it
I’m guessing it might have something to do with parent filter except?
m
Hi Jamie, it would by
SELECT x BY ALL OTHER
This would give you the same (overall) value of x for all the cells - this expression prevents the valie to be broken by any aytribute. The documentatiom for this is here, but I agree that there is not very much examples what it does and how it can be used. So your percent metric will look something like:
SELECT x / (SELECT x BY ALL OTHER)
Btw
BTW this metric only prevents from breaking the value by attributes, it doea not prevent it from being filtered (so if you filter your insight to year 2023 you will get percentages of 2023, not of overall percentages across all years). That is usually what you want for percentages. But if not, then the WITH PARENT FILTER EXCEPT (or WITHOUT PARENT FILTER) you mentioned do not prevent the values from being broken but from being filtered. And you can combine these: SELECT x BY ALL OTHER WITHOUT PARENT FILTER will give you global unfiltered overall number of x.
j
great thanks for the quick reply
confirmed this appears to have worked when implemented
1
👍 1