Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Logic help/Thoughts please.

I have the below logic where based on the Pay_frequency the Amount is being calculated for each subID,Expense Type and ExpenseID.

Aggr((Max([Amount]) * Pick(Match(pay_frequency, 'Monthly', 'Quarterly', 'Annually', 'Semi Annually','One Time'), 12, 4, 1, 2,1)),

subID,[Expense Type],ExpenseID))))

Now I am having a scenario where One subID doesnt have Amount for all 12 months ...it only has amount for 5 months....but based on the logic it is picking the Max of amount and multiplying by 12 as the Frequency is Monthly.How can I avoid this scenario ?

Thank mush for your help.

1 Solution

Accepted Solutions
sunny_talwar

How about this:

=Sum(Aggr((Max([Amount]) *

Pick(Match(pay_frequency, 'Monthly', 'Quarterly', 'Annually', 'Semi Annually','One Time'), Count(DISTINCT [Month of Expense]), 4, 1, 2,1)),SubID,[Expense Type],ExpenseID))

View solution in original post

4 Replies
sunny_talwar

Would you be able to share a sample to test out some possibilities?

Not applicable
Author

Sure stalwar1  .

PFA Excel and the QVW.If you see SubID 500 it only has 4 months of data but because of the frequency Type it is multiplying it 12 times.

Thanks much for all your help.

sunny_talwar

How about this:

=Sum(Aggr((Max([Amount]) *

Pick(Match(pay_frequency, 'Monthly', 'Quarterly', 'Annually', 'Semi Annually','One Time'), Count(DISTINCT [Month of Expense]), 4, 1, 2,1)),SubID,[Expense Type],ExpenseID))

Not applicable
Author

That works....thank yiu