Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
eddywong71
Creator
Creator

Need revise different Dimension each time to fresh the data

Hi All,

I have Two column  [Join Plan Month] , [Month] 

Dimension:

If( Date#([Join Plan Month],'YYYYMM') >= Date(MonthStart(vMaxMonthYear,-11) ,'YYYYMM')

, [Join Plan Month])

Expression :

SUM({$<Month ={'$(vMaxMonthYear)'}
>}[OPI])

 

Let say vMaxMonthYear default = 202312 the above expression will show [Join Plan Month] 202301-202312 in a line chart.

However, if i select [Month]= 202305 the  above expression will show [Join Plan Month] 202301-202305 in a line chart.

But if i create a new expression for example below it can fresh again.

If( Date#([Join Plan Month],'YYYYMM') <= Date(MonthStart(vMaxMonthYear,0) ,'YYYYMM')
AND
Date#([Join Plan Month],'YYYYMM') >= Date(MonthStart(vMaxMonthYear,-11) ,'YYYYMM')

, Date([Join Plan Month2],'MMM YY'))

But if i choose [Month] again the past 12 month don't refresh 

Labels (5)
1 Solution

Accepted Solutions
Kushal_Chawda

@eddywong71 

Use Dimension Join Plan Month & use below expressiion

Sum ({<[Join Plan Month]={">=$(=date(addmonths(max(Month),-11),'YYYYMM'))<=$(=max(Month))"}>}[OPI])

View solution in original post

4 Replies
Kushal_Chawda

@eddywong71  you may need to use set expression in your measure

Assuming your Your Month format is YYYYMM. You may need to use Date# to match format between Join Plan Month & Month

Sum ({<[Join Plan Month]={">=$(=date(addmonths(max(Month),-11),'YYYYMM'))<=$(=max(Month))"}>} Value)

eddywong71
Creator
Creator
Author

Hi 

My Dimension is 

If( Date#([Join Plan Month],'YYYYMM') >= Date(MonthStart(vMaxMonthYear,-11) ,'YYYYMM')

, [Join Plan Month])

My expression = 

SUM({$<Month ={'$(vMaxMonthYear)'}
>}[OPI])

Kushal_Chawda

@eddywong71 

Use Dimension Join Plan Month & use below expressiion

Sum ({<[Join Plan Month]={">=$(=date(addmonths(max(Month),-11),'YYYYMM'))<=$(=max(Month))"}>}[OPI])

eddywong71
Creator
Creator
Author

Thanks for your help !