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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Expression conditional

Hello,

I have the expression sum(sales).

i want to add the following formula if(variable=1,sum(sales)), however with this formula it only applies for the month that variable =1. i would like the expression to calculate the sales for all months if for one month the variable =1.

Thank you

Labels (1)
24 Replies
sunny_talwar
MVP
MVP

Like this?

Capture.PNG

Expression:

If(Max(TOTAL Registration) = 1, Sum({<Date, CLIENT = p(CLIENT)>}Sales), Sum(Sales))

Anonymous
Not applicable
Author

¿Can you explain me how did you do that?

i am going to reload with all my data.

i will tell you soon

sunny_talwar
MVP
MVP

Basically used a set analysis which ignores selection in Date field, but only shows the possible values of clients based on your date selection

If(Max(TOTAL Registration) = 1, Sum({<Date, CLIENT = p(CLIENT)>}Sales), Sum(Sales))

Anonymous
Not applicable
Author

thank you very much!!!

it is exactly what i needed.

one more cuestilon. what does client =p(client) do?

sunny_talwar
MVP
MVP

Look at my response above, I just explained it above. If you got what you wanted, please close this thread by marking correct and helpful responses.

Qlik Community Tip: Marking Replies as Correct or Helpful

Thanks,

Sunny