When the condition in sumIf is not met, Quicksight treats the row as not being there, not as zero. If you are adding things together, this is not a big deal, but it would be a big deal if you were using avgIf. So if all of the if conditions were false, Quicksight would have seen no entries. I know from other work that when Quicksight sees no entries, it displays a blank as opposed to a zero.
Here is an example where this would make more sense. Suppose you were displaying test scores, you would want to know the difference between someone who did not take a test and had no score, and someone who took a test and had a zero.
In any case, the calculated field I suggested turned the non-fields into zeros. This is fine for use in a sumIf.
Hi Andy, thank you for the workaround and the explanation. I am seeing the same issue. but my calculated field {numerator} ({balance} from above question) is a distinct_countIf({engagement_id}, condition1 AND condition2 …).
I did the ifelse, that works fine. named this field {numerator_c}
but when I try to do sum({numerator_c}), I get error:
“Nesting of aggregate functions like runningSum and RUNNINGSUM(SUM(CASE WHEN COUNT(DISTINCT CASE WHEN condition1 AND condition2 … is not allowed”
Here’s how I solved my issue:
1/ created a list of engagements based on condition using if-else logic in DataPrep. this contained duplicates. published dataset.
2/ Added a calculated field on UI using distinct_count(), partitioned over date and teams.
3/ Added a calculated field on UI for YTD using runningSum() on 2/ ; ordered by date , partitioned over teams.
Make sure to use the same partitions you want to show on the dashboard, otherwise there would be double counting. Thank you Andy for your help.