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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Display Last Three Months

The current equation below works to display max load date:

LOAD_DATE = {"$(=Date(Max(LOAD_DATE), 'YYYY/M'))"}

However, I would like the chart to display last 3 months. I tried below but this did not work.

LOAD_DATE = {"$(=Date(Max(LOAD_DATE) - 2, 'YYYY/M'))"}

Any suggestions?

Thank you,

- dave

Labels (1)
13 Replies
sunny_talwar
MVP
MVP

Try this:


LOAD_DATE = {">=$(=Date(AddMonths(Max(LOAD_DATE), - 2), 'YYYY/M'))"}

Anonymous
Not applicable
Author

Sunindia  - This helps, but I need the previous months to stay displayed even when the user picks a specific month.

For example, I have month options at the top of the application: Jan, Feb, Mar

When user clicks Mar, I want them to be able to see Mar, and the two previous months.

Hope this makes sense

sunny_talwar
MVP
MVP

What is the name of the dimension you are using for Month?

Anonymous
Not applicable
Author

BL_Month

sunny_talwar
MVP
MVP

See if this helps:

Try this:


{<LOAD_DATE = {">=$(=Date(AddMonths(Max(LOAD_DATE), - 2), 'YYYY/M'))"}, BL_Month = >}

Anonymous
Not applicable
Author

That did not seem to work. No data was displayed. Whole expression is below.

count({<

Field1={'Value1'},

Field2= {'Value2'},

LOAD_DATE = {">=$(=Date(AddMonths(Max(LOAD_DATE), - 2), 'YYYY/M'))"}>}

Line_ID)

sunny_talwar
MVP
MVP

Would you be able to share a sample?

Anonymous
Not applicable
Author

Unfortunately I cannot. But thank you for your help this far

sunny_talwar
MVP
MVP

So when you use this expression:

Count({<Field1={'Value1'}, Field2= {'Value2'}, LOAD_DATE = {">=$(=Date(AddMonths(Max(LOAD_DATE), - 2), 'YYYY/M'))"}, BL_Month = >} Line_ID)

you see no results?

but this works?

Count({<Field1={'Value1'}, Field2= {'Value2'}, LOAD_DATE = {">=$(=Date(AddMonths(Max(LOAD_DATE), - 2), 'YYYY/M'))"}>} Line_ID)


Is this what is happening?