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: 
deniscamh
Creator
Creator

Date Greater then variable in dimention

Hi all,

I am trying to create a Bar Chart with Dimension like this:

If(Date >= $(vMaxDateforDimen), Month).

Means the dimension will display only Months that are greater than Max date based on selection

vMaxDateforDimen = monthend(AddMonths(Max(dimSurveyReceivedDateItself),-$(vNumRollinMonth)))

vNumRollinMonth is a number that user can change to see more or less Months of data.

I cannot add it into expression as I have Alternative dimensions as Quarters and Years that should be affected by this formula.


Please help.

Thanks

7 Replies
OmarBenSalem

try:

If(Date >=aggr( $(vMaxDateforDimen),Date), Month).

or add this aggregation directly into the variable

deniscamh
Creator
Creator
Author

HI Omar,

Thanks for replay.

It works and displaying the value but unfortunately it does not limit number of Month and shows all the months.

Any Idea why?

OmarBenSalem

can't seem to understand.

maybe a screenshot of what u have? and what u want to have?

deniscamh
Creator
Creator
Author

Hi Omar,

Please see below.

in a top chart I use the number of Months to display in expression so when I use 5 month chart displays 5 months.

But I cannot use it in expression because I need to add Years as dimension as well and years should show full year value and not only last 5 months based on selection.

In the bottom chart  I use the formula you provided in dimension but it showas entire data for months without limiting it to 5 as it was chosen at the top.

I need the bottom chart show only five months as well.

Does it make sense?

month year in dimension.PNG

OmarBenSalem

can u share ur app? a test one maybe? with just these charts?

deniscamh
Creator
Creator
Author

Hi Omar,

Unfortunately I cannot share the app with real data and to create one with fake it will take too long.

Please let me know what kind of additional info you need from me and I will provide.

Thanks

deniscamh
Creator
Creator
Author

Hi Omar,

Just wanted to ask if you would be able to help me with this issue without having the app?

Please let me know.

Thanks