Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

view last 6 month

Hello Qlik

How can I see on my trend chart, only last 6 month?

Attached screenshot of the trend (accumulative sum).

11 Replies
vinieme12
Champion III
Champion III

Check the attached sample

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

The sample is empty.

Not applicable
Author

Its Qlikview file and i use Sense. Its matter?

vinieme12
Champion III
Champion III

use a YearMonth field which has values like 201601,201602,....201701,201702...and so on

Create variables

vStartYearMonth = NUM#(year(Today()) & NUM(month(Today()),'00'))

vEndYearMonth = NUM#(Date(Addmonths( Date#($(vStartYearMonth),'YYYYMM'),-6),'YYYYMM'))

vPeriodRange = ='>'&$(vEndYearMonth)&'<'&$(vStartYearMonth)

Your expression will then be

sum({<YearMonth = {'$(vPeriodRange)'}>} Amount)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

Not works. The expression is ok but not works for the trend.

Anonymous
Not applicable
Author

Use this Ex:

Count({<PageFeedsDate = {">=$(=MonthStart(Max(CommonDate), -5

))<=$(=MonthEnd(Max(CommonDate)))"}>}distinct [Comments ID])

vinieme12
Champion III
Champion III

works for me buddy, check the sample

have you defined the variables correctly they all must start with the equal sign "="

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

My date field is YYYY-MMM because i use the month as the name. There is a way to convert it back not in the script?

Or maybe to use it format in the variables?

Thanks!

Not applicable
Author

Hi Rut

Can you please explain the fields?

PageFeedsDate - my date field

Comments ID - my series (the measure)

CommonDate?

In addition, the analysis contains apostrophes ("") between the monthstart function in way that the expression dont recognize the function.

Thank you for the answer.