Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
lucasdavis500
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
sunny_talwar

May be like this:

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

View solution in original post

5 Replies
sunny_talwar

May be like this:

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

lucasdavis500
Creator III
Creator III
Author

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

sunny_talwar

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
Creator III
Creator III
Author

=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
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.