Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Qlik
How can I see on my trend chart, only last 6 month?
Attached screenshot of the trend (accumulative sum).
Check the attached sample
The sample is empty.
Its Qlikview file and i use Sense. Its matter?
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)
Not works. The expression is ok but not works for the trend.
Use this Ex:
Count({<PageFeedsDate = {">=$(=MonthStart(Max(CommonDate), -5
))<=$(=MonthEnd(Max(CommonDate)))"}>}distinct [Comments ID])
works for me buddy, check the sample
have you defined the variables correctly they all must start with the equal sign "="
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!
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.