Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
bharatkishore
Creator III
Creator III

Set analysis Expression

Hi All,

I have one straight table chart and i have written this set analysis expression.

The problem is the expression is not working it is still showing 2017 values but it should show 2016 december values.

The expression is:

=SUM({<MonthYear={">=$(=Date(AddMonths(Max(MonthYear), -1)))<=$(=Date(Max(MonthYear)))"}>}IB)

Attached app for reference.

Thanks,

Bharat

6 Replies
mdmukramali
Specialist III
Specialist III

Hi,

You have to exclude the selection of the Month Field from Expression.

try the below Expression.

=SUM({<MonthYear={">=$(=Date(AddMonths(Max(MonthYear), -1)))<=$(=Date(Max(MonthYear)))"},Month=>}IB)

if you want only previous Month then try below expression.

=SUM({<MonthYear={">=$(=Date(AddMonths(Max(MonthYear), -1)))<$(=Date(Max(MonthYear)))"},Month=>}IB)

Thanks,

Mukram

bharatkishore
Creator III
Creator III
Author

Hi Mukram,

Thanks for you reply. Pls find the attached app.

Here if i select Jan the data is not showing in the graph.. The expression is working fine and the values are correct but i want to see Jan in chart..

Pls let me know if you need anything more..

mdmukramali
Specialist III
Specialist III

Hi Bharat,

find the attached App.

bharatkishore
Creator III
Creator III
Author

Hi Mukram,

Thanks for your time but the format i need is the below one:

T.PNG

In your app we can see only December but the dimesions should be selected months for example say Jan. .I need to see jan dimesion but the expression should always show only december values.

Please let me know if you need anything more..

mdmukramali
Specialist III
Specialist III

HI Bharat,

In the Set Analysis, we are applying the condition on Month also so if you select Jan from Month it will show you Dec in the chart,

maybe you can try to create a new field in the script like what I did in the attached application,

sunny_talwar

May be this

=Sum({<MonthYear={">=$(=Date(AddMonths(Max(MonthYear), -1)))<$(=Date(Max(MonthYear)))"}, Month>}IB)

Capture.PNG