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

Set Analysis with three measures

Hi,

Is it possible to write below condition in set analysis?

If(Country='A' and Company='A', sum(Net Sales),

If (Country='B'  and Company='B', sum(Gross Sales),

sum(Total Sales)))

 

Thanks.

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

You can try this

RangeSum(
Sum({<Country = {'A'}, Company = {'A'}>} [Net Sales]),
Sum({<Country = {'B'}, Company = {'B'}>} [Gross Sales]),
Sum({<$-(<Country = {'A'}, Company = {'A'}>+<Country = {'B'}, Company = {'B'}>)>} [Total Sales])
)

View solution in original post

5 Replies
Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

try this

Sum(If(Country='A' and Company='A', (Net Sales),If (Country='B'  and Company='B', (Gross Sales),(Total Sales))))

Thanks

Thanks and Regards
Kashyap.R
Prav
Contributor II
Contributor II
Author

Hi thanks for your reply. That is not the solution I want. I want the condition in set analysis.

sunny_talwar

You can try this

RangeSum(
Sum({<Country = {'A'}, Company = {'A'}>} [Net Sales]),
Sum({<Country = {'B'}, Company = {'B'}>} [Gross Sales]),
Sum({<$-(<Country = {'A'}, Company = {'A'}>+<Country = {'B'}, Company = {'B'}>)>} [Total Sales])
)
Kashyap_R
Partner - Specialist
Partner - Specialist

Hi 

Can u tell me more about what you want exactly and if possible attach the output you want

Thanks

Thanks and Regards
Kashyap.R
Brett_Bleess
Former Employee
Former Employee

Did Sunny's post get you the solution you needed?  If so, be sure to return to the thread and use the Accept as Solution button on it to give him credit for the assistance and let other Community Members know that worked.  Here are some other Design Blog and Help links regarding Set Analysis that may help in the future:

https://community.qlik.com/t5/Qlik-Design-Blog/A-Primer-on-Set-Analysis/ba-p/1468344

If you want to search the Design Blog further, here is the base URL for that:

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

Help link:

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/ChartFunctions/...

Regards,
Brett

 

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.