H! I have a table with answers coming from a multiple choice question.
The counts are OK, but the percentages are not. Instead of using the correct total which is 270 and it's shown correctly in the scorecard, in the table it's using 260 to calculate the percentages.
The formula used to calculate the percentages in the table is:
CASE
WHEN 01. Known platforms = "X"
THEN X
WHEN 01. Known platforms = "Y"
THEN Y
...
ELSE NULL
END
Do you know what could be wrong? Thank you,
EDIT: I have added another calculation for the percentages and it works well
SUM(CASE
WHEN regexp_contains(01. Known platforms, 'X') THEN 1
ELSE 0
END) / COUNT(01. Known platforms)
But it seems like a lot of work to have these 2 columns, do you know of a simpler solution?
I don't know if this is possible here, but I wonder if your 260 versus 270 issue is because the 260 is a distinct count?