Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis and if condition

Hi,

I'm working on a pivot table that requires the user to select a single month first and then will display amounts in different categories for this month. So far this works.

Now I'm trying to display the development in a category in a mini chart within the table, with the month (MonthID) as dimension.

Using set analysis I can "break out" of the month selection the user made successfully, ie

sum({<MonthID=>}Amount)

This works fine too.

Now what I'm trying to accomplish is that this mini chart is only displayed when the amount *for the month the user has selected*  is negative.

So the mini chart should display the amount development over time, including potentially positive amounts in months different to the one that the user has selected (but only if the amount in the month the user has selected is negative).

I tried this, but this leads to nothing, it seems the whole set analysis is not working using this formula because this will only show data for the month the user has selected

=if(sum(Amount)<0,sum({<MonthID=>}Amount))

Why is this happening and what can I do about it?

Thanks a lot for any help about this!

3 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Try including set analysis in the condition also.

     =if(sum({<MonthID=>}Amount)<0,sum({<MonthID=>}Amount))

Hope it helps

Celambarasan

perumal_41
Partner - Specialist II
Partner - Specialist II

Hi

Try this method .is useful for u

=sum({<MonthID=,DateFeild={'sum(Amount)<0'}>}Amount)

Regards

Perumal A

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this expression

=If(Sum({<MonthID=>}Amount) < 0, Sum({<MonthID=>}Amount), 0)

Hope this helps you.

Regards,

Jagan.