Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression help with if

=sum(if([Expense Month-Year]='Mar-2016' ,

            if([Expense Month-Year]='Apr-2016',

(Aggr((Max([Amount of Expense]) * Pick(Match(pay_frequency, 'Monthly', 'Quarterly', 'Annually', 'Semi Annually','One Time'), 12, 4, 1, 2,1)),%SubspaceKey,[Expense Type],%ExpenseKey))))

but the below expresson with one if is working fine.

=sum(if([Expense Month-Year]='Mar-2016' ,

         

(Aggr((Max([Amount of Expense]) * Pick(Match(pay_frequency, 'Monthly', 'Quarterly', 'Annually', 'Semi Annually','One Time'), 12, 4, 1, 2,1)),%SubspaceKey,[Expense Type],%ExpenseKey)))


How can I put it for multiple if's.Thank you.

5 Replies
sunny_talwar

Sure, try this:

Sum(If(Match([Expense Month-Year], 'Mar-2016', 'Apr-2016'),

Aggr((Max([Amount of Expense]) * Pick(Match(pay_frequency, 'Monthly', 'Quarterly', 'Annually', 'Semi Annually','One Time'), 12, 4, 1, 2,1)),%SubspaceKey,[Expense Type],%ExpenseKey)))

Not applicable
Author

Its returning 0

sunny_talwar

Are you using this in a chart or text box object?

Not applicable
Author

In charts..Bar chart,straight table

sunny_talwar

Would it be possible to share a sample?