Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

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

May be like this:

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

View solution in original post

5 Replies
Highlighted

May be like this:

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

View solution in original post

Highlighted
Creator III
Creator III

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

Highlighted

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

Highlighted
Creator III
Creator III

=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

Highlighted
Master II
Master II

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