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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

dimension limits display last 6 months

Hi, in line chart, how do I display data for only the last 6 months? Cause' dimension limits only have the option of displaying first,largest and smallest values. Thanks.

5 Replies
Not applicable
Author

Sum({$ < Year = {">=$(Year(Today())-5)"}>} Sales)

Not applicable
Author

if it is just a simple dimension, then create a calculated dimension as follows:

if (Year >= Year(today())-5, Year)

Then check "Suppress when null"

Thanks,

Ram

jagan
Partner - Champion III
Partner - Champion III

Hi Rachel,

Try this expression

=Sum({< YearDimensionName=, QuarterDimensionName=, MonthDimensionName =, DateDimensionName= {'>=$(=MonthStart(Max(DateDimensionName), -5))<=$(=Date(Max(DateDimensionName)))'}>} MeasureName)



Replace YearDimensionName, QuarterDimensionName, MonthDimensionName, DateDimensionName and MeasureName with your actual fields.


Hope this helps you.


Regards,

Jagan.


Not applicable
Author

Hi Jagan,

How can I do this in dimenssion level.

Regards

Anup

Anonymous
Not applicable
Author

Hi,

Try

In UI:

=Sum({<YearMonth=, Num(Date#(YearMonth,'YYYYMM')) = {">=$(=Num(AddMonths(Max(Date#(YearMonth,'YYYYMM')),-5)))<=$(=Num(AddMonths(Max(Date#(YearMonth,'YYYYMM')),0)))"}>} MeasureName)

Or

Inscript:

LOAD *,

if(
Date >= AddMonths(MonthStart(today()), -5) and Date <= monthstart(today()), 1, 0) as Flag6Month

RESIDENT Table;

And use flag as required

Regards

Neetha