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: 
BI_Dev
Creator II
Creator II

Total function

Client Country City ID Flag Sales Expected
AAA India Bangalore 1 Y 300 600
AAA India Bangalore 2 N 300 300
BBB India Bangalore 1 Y 300 500
BBB India Bangalore 2 N 200 200

 

I have data as above...I want to create the last column and it will based on the Total column.
If Flag = Yes, sum(total <Client,City> Sles), sum(Sales).

IF Flaf is yes, I want the total sales by client and city...here 600 is 300+300 for Client AAA in Bangalore.I tried the above logic, but it is not working.

 

Can someone please let me know what am I missing.

Labels (3)
2 Replies
MatheusC
Specialist III
Specialist III

Hi @BI_Dev ,

Except '' and open and close the if(), the rest is ok, to achieve this result.
if(Flag='Y',
sum(total <Country,City> Sales) , sum(Sales) )

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
MatheusC
Specialist III
Specialist III

@BI_Dev 
Close the topic with the solution provided.

Thanks

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!