Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Total not working at bottom of straight table

Hi,

I am hoping someone can help me. I have the formula below which gives me the correct figures that I need but the Total line at the bottom of the straight table is just showing a dash. I have tired moving the location of the Sum to the start of the formula which then shows the total but only using one if statement.

IF Statement Expression

If(Performance_Category = 'Red8', Sum ({<year={$(=max(year))},TeleAdviceFlag=-{1}>} ActualIncidents),

If(Performance_Category = 'Red19', Sum ({<year={$(=max(year))},TeleAdviceFlag=-{1}>} ActualIncidents),

If(Performance_Category = 'Amber20', Sum ({<year={$(=max(year))},TeleAdviceFlag=-{1}>} ActualIncidents),

If(Performance_Category = 'Green60', Sum ({<year={$(=max(year))}>} ActualIncidents),

If(Performance_Category = 'Urgent', Sum ({<year={$(=max(year))},TeleAdviceFlag=-{1}>} ActualIncidents),

If(Performance_Category = 'Routine', Sum ({<year={$(=max(year))},TeleAdviceFlag=-{1}>} ActualIncidents)))))))

This is the other one I tried but could only make it work on the one if statement.

Sum({<year={$(=max(year))}>}(If(Performance_Category = 'Red8', ActualIncidents)))

Would appreciate any help people can give me

Thanks

1 Solution

Accepted Solutions
danielrozental
Master II
Master II

to make your expression work as it is you would need to do something like

sum(aggr(

<your expression here>

, Performance_Category))

I would also suggest changing it to something like

Sum ({<year={$(=max(year))},TeleAdviceFlag=-{1}, Performance_Category={'Red8','Red19','Amber20','Urgent','Routine'}>} ActualIncidents)

+ Sum ({<year={$(=max(year))},Performance_Category={'Green60'}>} ActualIncidents)

View solution in original post

2 Replies
danielrozental
Master II
Master II

to make your expression work as it is you would need to do something like

sum(aggr(

<your expression here>

, Performance_Category))

I would also suggest changing it to something like

Sum ({<year={$(=max(year))},TeleAdviceFlag=-{1}, Performance_Category={'Red8','Red19','Amber20','Urgent','Routine'}>} ActualIncidents)

+ Sum ({<year={$(=max(year))},Performance_Category={'Green60'}>} ActualIncidents)

Not applicable
Author

Thank you so much I used the solution you gave at the bottom of your reply and it give me to correct answer when I calculated the figures together.

Thank you again

Sum ({<year={$(=max(year))},TeleAdviceFlag=-{1}, Performance_Category={'Red8','Red19','Amber20','Urgent','Routine'}>} ActualIncidents)

+ Sum ({<year={$(=max(year))},Performance_Category={'Green60'}>} ActualIncidents)