7 Replies Latest reply: Sep 17, 2012 10:36 AM by Mayil Vahanan Ramasamy

# 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!

• ###### Re: Set Analysis

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

• ###### Re: Set Analysis

Hi,

Please send us the expected output with some selection.

Regards,

Kaushik Solanki

• ###### Re: Set Analysis

Please find attahced the expected output file.

• ###### Re: Set Analysis

Hi friend ,

I think it will work for you

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

regards

Kamal

• ###### Re: Set Analysis

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

• ###### Re: Set Analysis

Hello,

 Product Pack No Qty1 Qty2 1 1 40 40 2 2 40 10 2 3 40 10 2 4 40 20

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..!

• ###### Re: Set Analysis

Hi

Use Product and PackNo as dimension,

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