Datasets

Datasets

Case statement not counting correctly

(SUM(CASE
WHEN Age >= 31 AND Age<= 60 THEN 1
ELSE 0
END) / Total Inventory) * 100

When I break up the statement it only returns 0 and there is a handful that are in the data. I have check the filters and if I'm able to see it I don't understand why it doesn't count. Any ideas?

Best Answer

  • Coach
    Answer ✓

    @Josh_Evans20 This issue is likely that your numerator is aggregated and your denominator is not. What does Total Inventory represent and is there a way you could restructure it as an aggregation?

Answers

  • Could you share screenshots of your setup in analyzer? Also what do you mean when you break up the statement?

    The beastmode appears correct and should be returning values.

    If I solved your problem, please select "yes" above

  • Coach
    Answer ✓

    @Josh_Evans20 This issue is likely that your numerator is aggregated and your denominator is not. What does Total Inventory represent and is there a way you could restructure it as an aggregation?

Welcome!

It looks like you're new here. Members get access to exclusive content, events, rewards, and more. Sign in or register to get started.
Sign In