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: 
samp1
Contributor II
Contributor II

Set Analysis row level comparison

I have Table as below,  and I am trying row-level comparison with below expression, is it possible.

Load * Inline [
Country, poplation
Ind,200
Ind,200
USA, 300
USA, 300
Can, 500
Can, 500
Chn, 400
Chn, 400
GER, 300
GER, 300
Asia,0
Asia,0
NAMR,0
NAMR,0
];

 

My Expression: 

if (Country='Asia', Sum({<Country={'Ind','Chn'}>}poplation),
if (Country='NAMR', Sum({<Country={'USA','Can'}>}poplation),
Sum(poplation)))

I am expecting for Asia=1200 and NAMR=1600 in the same below chart.

samp1_0-1639415405442.png

 

 

 

Labels (2)
1 Solution

Accepted Solutions
chrismarlow
Specialist II
Specialist II

Hi,

You would need to put TOTAL in, so something like (not tested);

if (Country='Asia', Sum(TOTAL {<Country={'Ind','Chn'}>}poplation),
if (Country='NAMR', Sum(TOTAL {<Country={'USA','Can'}>}poplation),
Sum(poplation)))

Cheers,

Chris.

View solution in original post

1 Reply
chrismarlow
Specialist II
Specialist II

Hi,

You would need to put TOTAL in, so something like (not tested);

if (Country='Asia', Sum(TOTAL {<Country={'Ind','Chn'}>}poplation),
if (Country='NAMR', Sum(TOTAL {<Country={'USA','Can'}>}poplation),
Sum(poplation)))

Cheers,

Chris.