Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Expression with condition on a list

Hello,

I would like to calculate the sum of number of calls for a list of account.

Let's say I have added a condition in the load manager to extract only a list of account.

I set it us as a flag "Y" if the account is in the list, "N" if it's not.

So I wanted to calculate the sum of number of calls for this list of account that got the condition "Y"

I used this

sum({$<[Central Account #]=P({1<Flag={‘Y’}>})>} [Nb of Cases])

But it gave me 0.

Do you have any idea what I did wrong?

Thank you so much for your help,

8 Replies
micheledenardi
Specialist II
Specialist II

You have forgot the dimension that P()  function has to returns.

So, your set analysis could be something like:

sum({$<[Central Account #]=P({1<Flag={‘Y’}>}[Central Account #])>} [Nb of Cases])



If you need other information on how to use P() or E() check the below links:

P() &amp; E() and where do you use them?

Set Analysis: syntaxes, examples

QlikView | Set Analysis | p(), e() and other aggregation function - YouTube

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
antoniotiman
Master III
Master III

Try this

sum({<Flag={‘Y’}>} [Nb of Cases])

Anonymous
Not applicable
Author

Thank you Michel for your answer,

I used your correction, but it's still showing 0 😕

I really don't know what went wrong

Anonymous
Not applicable
Author

Thank you Antonio,

This is actually what I used before using this expression sum({$<[Central Account #]=P({1<Flag={‘Y’}>})>} [Nb of Cases])

But it was showing the total number of cases, like it was not taking into account my condition

micheledenardi
Specialist II
Specialist II

Can yuo share some sample data and the expected result ?

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

Sure,

so basically, here is my flag in the data load editor

If([Next 1A Contract End]>=Date(Now()) and [Next 1A Contract End]<=Date(Now()+180),'Y','N') AS Flag,

basically it shows this dashboard

account list.png

so my objective is to display the number of calls generated by the number displayed 564 accounts.

is that clarifying a bit?

Thanks

micheledenardi
Specialist II
Specialist II

Can you share some sample data in excel format or directly the .qvf ?

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

here you go

sample1.png

I couldn't attach the excel, this is basically a sample of list of account, and I want the number of calls for those accounts only

Do you need me to attach something else?

Thanks