Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis

Greetings All,

Can you please advise how can I write this  below query in Set analysis in a pivot table:

IF( count(bat_no) > 1, SUM(new), SUM(old))

Many Thanks!

7 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    Here is your Expression.

    Sum(if(aggr(count(Bat_no),Dimension1,Dimension2,..) > 1,New,Old))

    Here add the dimensions name which you have included in your chart.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
kamalqlik
Partner - Specialist
Partner - Specialist

Hi friend ,

I think it will work for you

=sum(if(count({< bat_no= {'>=1'}>}New,Old)))

regards

Kamal

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    Please send us the expected output with some selection.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Please find attahced the expected output file.

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi Pihu,

Can I suggest you write out what you wanted to achieve. As often the case, solution to the problem might not require Set Analysis function. If you can explain what the problem is and what you wanted to achieve might be helpful.

Best Regards,

Gabriel

Not applicable
Author

Hello,

ProductPack NoQty1Qty2
114040
224010
234010
244020

According to this table while product count of pack no is equal to 1 then it should be qty1 else qty2.

This is what I need to calculate in a pivot table.

Thanks..!

MayilVahanan

Hi

     Use Product and PackNo as dimension,

     Use if(PackNo =1, sum(Qty1), sum(Qty2)) as expression

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.