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

Set Analysis

Hi All,

I have a query

i have to show sum(Profit )..

There are certain conditions i have to put in set analysis:

ProductCat                 CategoryName

A                                       Bb

B                                       Aa

C                                       Dd

D                                       Ee

 

if i select data for productCat then it should show the data for Bb, for B --> Dd,Ee,

C->all data ,D-->only Aa

how can i write the expression in set analysis for this situation to calculate sum of profit.

 

Thanks in Advance

Labels (1)
1 Solution

Accepted Solutions
sidhiq91
Specialist II
Specialist II

@sagarwal16  I was thinking something like a below expression. Let me know if it helped you.

if((isnull(GetCurrentSelections()) or GetFieldSelections(ProductCat)='C'),
Sum(Profit),
if(GetFieldSelections(ProductCat)='A', sum({<CategoryName={'Bb'}>}Profit),
if(GetFieldSelections(ProductCat)='B', sum({<CategoryName={'Dd','Ee'}>}Profit),
if(GetFieldSelections(ProductCat)='D', sum({<CategoryName={'Aa'}>}Profit),
))))

View solution in original post

3 Replies
sidhiq91
Specialist II
Specialist II

@sagarwal16  is there any logic on why you would like to pick data in this manner? We can get this done anyway. But wanted to know if there is any specific reason behind it?

sagarwal16
Partner - Contributor II
Partner - Contributor II
Author

user want to be like this.. i cant do anything:(

sidhiq91
Specialist II
Specialist II

@sagarwal16  I was thinking something like a below expression. Let me know if it helped you.

if((isnull(GetCurrentSelections()) or GetFieldSelections(ProductCat)='C'),
Sum(Profit),
if(GetFieldSelections(ProductCat)='A', sum({<CategoryName={'Bb'}>}Profit),
if(GetFieldSelections(ProductCat)='B', sum({<CategoryName={'Dd','Ee'}>}Profit),
if(GetFieldSelections(ProductCat)='D', sum({<CategoryName={'Aa'}>}Profit),
))))