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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use Set Analysis to Limit Data in a Chart?

Hi I have a MonthYear field Jan-13, Feb-13, Apr-13, May-13 etc etc, and I only need to show the last 6 months of data in a chart?

Is there anyway I can use set analysis within my expression to do this?

Many thanks.

6 Replies
er_mohit
Master II
Master II

See the file attached

sushil353
Master II
Master II

Yes,

Try like this..

here i am assuming date_field having MM/DD/YYYY format.

sum({<date_field={">=date(max(date_field)-6,'MM/DD/YYYY') <max({1}date_field)"}>}value)

HTH

Sushil

saumyashah90
Specialist
Specialist

=(only({1}{< [Month Year]={"Jan-13,Feb-13,Mar-13,etc"}>} [Data Field]))

Not applicable
Author

Hi,

Thanks for all your replies.  I have just noticed that in my dataset I have a rolling_12 month flag which is has values 1-12.   So, I suppose I need to show all data where rolling_month is < 6.  Would the set analysis be easier using this field?

Many thanks again,

Not applicable
Author

Hi, Thanks for your sample.  Unfortunately, I  am unable to see the properties of the chart.  The only way I can open the file is to 'open in server'.

Can you post your expresion please?

Thanks again,

er_mohit
Master II
Master II

here in script i have two Date Format

date(Date,'MMM-YYYY')AS DATE,   //Bold one is my Date field

date(Date,'DD-MM-YYYY')AS Date

in dimension i used  this date field-->DATE  ..meand MMM-YYYY

in expression

write this

sum({<Date = {">=$(=MonthStart(Max(Date), -6))<=$(=MonthEnd(Max(Date)-1))"},Year=,Month=>}Sale)

Hope it helps