Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

deniscamh
Contributor

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
Esteemed Contributor

Re: Date Greater then variable in dimention

try:

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

or add this aggregation directly into the variable

deniscamh
Contributor

Re: Date Greater then variable in dimention

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
Esteemed Contributor

Re: Date Greater then variable in dimention

can't seem to understand.

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

deniscamh
Contributor

Re: Date Greater then variable in dimention

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
Esteemed Contributor

Re: Date Greater then variable in dimention

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

deniscamh
Contributor

Re: Date Greater then variable in dimention

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
Contributor

Re: Date Greater then variable in dimention

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