Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

Last 6 months - Line Chart

Per other blogs I have the below expression. I would like to only display the lattest 6 months.

Current Expression that I'm using below but nothing has changed. Could it be that MC_SERVICE_DATE_YYYMM is not in a date format?

SUM({<MC_SERVICE_DATE_YYYYMM={'>$(=AddMonths(Max(MC_SERVICE_DATE_YYYYMM),-6))'}>} TOTAL_PHONE_CONTACTS)

Tags (2)
1 Solution

Accepted Solutions
Highlighted
Creator III
Creator III

Re: Last 6 months - Line Chart

My dimesion is not a date. I was able to only display x values by using the Dimesion Limits tab to show FIRST x values, worked great.

View solution in original post

6 Replies
Highlighted
Specialist III
Specialist III

Re: Last 6 months - Line Chart

Hi,

Could be. Try to put Max() function in a Date(Max(MC_SERVICE_DATE_YYYYMM), 'Your Date Format')

Highlighted
Creator III
Creator III

Re: Last 6 months - Line Chart

Can you provide an example of how the full expresion should look?

Highlighted
Creator III
Creator III

Re: Last 6 months - Line Chart

The sums are correct but my current expression is not displaying only 6 months/values

Highlighted
Specialist III
Specialist III

Re: Last 6 months - Line Chart

Since I don't know your date format, but you can use 'MM/DD/YYYY' or 'YYYY-MM-DD' in 'Your_Date_Format' field. This should work:

SUM({<MC_SERVICE_DATE_YYYYMM={'>$(=AddMonths(Date(Max(MC_SERVICE_DATE_YYYYMM),'Your_Date_Format'),-6))'}>}TOTAL_PHONE_CONTACTS)

Highlighted
Creator III
Creator III

Re: Last 6 months - Line Chart

My dimesion is not a date. I was able to only display x values by using the Dimesion Limits tab to show FIRST x values, worked great.

View solution in original post

Highlighted
Specialist
Specialist

Re: Last 6 months - Line Chart

Try:

SUM({<MC_SERVICE_DATE_YYYYMM={">$(=AddMonths(Max(MC_SERVICE_DATE_YYYYMM),-6))"}>} TOTAL_PHONE_CONTACTS)


or


SUM({<MC_SERVICE_DATE_YYYYMM={">$(=Date(AddMonths(Max(MC_SERVICE_DATE_YYYYMM),-6)))"}>} TOTAL_PHONE_CONTACTS)



Anyway, replace simple quote for double-quote.



Hope this helps!