Case statement not counting correctly

Options

(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

  • MichelleH
    MichelleH Coach
    Answer ✓
    Options

    @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

  • ColemenWilson
    Options

    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

  • MichelleH
    MichelleH Coach
    Answer ✓
    Options

    @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?