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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Could anyone demonstrate nested Set Analysis in QV

Hello All,

I m facing problem while framing the Nested Set Analysis Expression in QV 9.

My Condition is :-

Set CurrentMonth='201309';

count(IF YrMonth=CurrentMonth and Product<>'abc',if(YrMonth=CurrentMonth and Product='abc','column3'),column1)

/

count(if(YrMonth=CurrentMonth and Product<>'abc',if(YrMonth=CurrentMonth and Product='abc',column4) ),colum2)

Same above Condition interpretation in Set Analysis Expression:-

Count({$<YrMonth= {'$(CurrentMonth)'},ProductName-{'abc'}>} column1)/Count({$<YrMonth = {'$(CurrentMonth)'},ProductName-{'abc'}>} column2)

Now how should i proceed further with adding condition ProductName='abc'.

I tried but it doesn't worked .

Could anyone please suggest me... how should i proceed further.

Thanks & Regards,

Girish Chhatani

3 Replies
simondachstr
Specialist III
Specialist III

ProductName={'abc'} and I should work fine imo.

Anonymous
Not applicable
Author

Martin,

Thnks for ur reply.

Ur interpretation:-

Count({$<YrMonth= {'$(CurrentMonth)'},ProductName-{'abc'}>,ProductName={'abc'},colum3} column1)/Count({$<YrMonth = {'$(CurrentMonth)'},ProductName-{'abc'}>} column2)

it doesnt work... actually this added code ProductName={'abc'} will add one more condition like and operator.

I want to add one more if block.

Thanks & Regards,

Girish Chhatani

simondachstr
Specialist III
Specialist III

Now I see where you're coming from.

I don't think you'll be able to do that with Set Analysis, as your if condition does not apply to the data set but rather on the column name.

I suggest you either outsource your if block into a variable (to determine which column to use in the expression) or write multiple expressions and have them displayed/calculated conditionally.

However, I believe there should be a smarter way to solve this challenge without any if blocks at all.