Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
jmialoundama
Specialist
Specialist

Set analysis - Show next 24 months in graph

Hi, 

I want to show only the nest 24 months in my graph. 

My set analysis show me all months. 

My set analysis it's : 

=Count({$<[Type période] = {'Mois'},Pivot_Date_Type = {'Date Entree stock livraison contractuelle'},[Année période] =, [Mois période] =, [Semaine période] =,date_mast={">$(=MonthStart(AddMonths(Today(), -24)))"}>}entree_stock_pn_ic)

jmialoundama_0-1669634285826.png

Thanks in advance

 

3 Replies
lukas_
Contributor III
Contributor III

Hi,

Have you defined the set analysis with the -24 months on the same dimension as that of your chart (date_mast?)?

jmialoundama
Specialist
Specialist
Author

Hello @lukas_ ,

Thanks for your feedback.
Indeed the error comes from the fact that the dimension that I display in my graph, is not the same as that used in my set analysis.

In my chart I display a date in MM YYYY format and in my set analysis I use a dimension in DD/MM/YYYY format.

I tried to put the dimension in MM YYYY format in my set analysis but it doesn't work:

=count({$<[Type période]={$(=MinString([Type période]))},Pivot_Date_Type = {'Date Entree stock livraison contractuelle'},[Année période] =, [Mois période] =, [Semaine période],date_mast={">=$(=monthstart(today()))<=$(=monthend(today(), 24))"}>}entree_stock_pn_ic)

I want to replace the dimension date_mast by dimension periode_dual and the format of periode_dual it's MM YYYY.

Thank you in advance for your help

lukas_
Contributor III
Contributor III

If your dimension is really in MM YYYY format (with only the 1st of each month), you can use the MonthName() function in your set analysis to round to the beginning of the month.

dimensionOnXAxis = {">$(=num(MonthName(AddMonths(Today(), -24))))"}

NB : Maybe it works without the num()