Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

lucasdavis500
Contributor II

Using calculated dimensions in charts/graphs

I'm using a calculated dimension one of my charts

=if(Model2.Month_Res = $(vTwoMonthLag), Model2.Month_Res)

On the charts themselves, the dimension seems to return "Null"

dimensions.png

Is this the proper way to calculate a single month for a dimension??

where vTwoMonthLag =

"$(=Month(AddMonths(Date(Today()),-2)))"

1 Solution

Accepted Solutions
Highlighted

Re: Using calculated dimensions in charts/graphs

May be like this:

=If(Model2.Month_Res = Month(AddMonths(Today(), -2)), Model2.Month_Res)

5 Replies
Highlighted

Re: Using calculated dimensions in charts/graphs

May be like this:

=If(Model2.Month_Res = Month(AddMonths(Today(), -2)), Model2.Month_Res)

lucasdavis500
Contributor II

Re: Using calculated dimensions in charts/graphs

That worked, I suppose having the variable in there added an extra '=' in

Re: Using calculated dimensions in charts/graphs

Yes that could have been the issue, but I am not sure how you have your variable setup and this is why gave you a direct expression without any variable

lucasdavis500
Contributor II

Re: Using calculated dimensions in charts/graphs

=if(Model2.Month_Res = $(vTwoMonthLag), Model2.Month_Res)

where $(vTwoMonthLag) = "$(=Month(AddMonths(Date(Today()),-2)))"

so it was definitely the variable, I have that variable stored for Set analysis, not use in a dimension

buzzy996
Honored Contributor II

Re: Using calculated dimensions in charts/graphs

hi,I think u have to create tht variable in load script and u can use on ur chat,tht will work.