Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
kevin8
Contributor
Contributor

Variable dependent on another variable with if & dimensions

Is there a way that i can have a variable dependent on another variable?

Basically, I have two data sets, one is based on accounting periods the other transaction dates, they don't really tie together well, so its best we leave them distinct, but they contain almost the same data, so i have measures switching based on whether the first variable is 1 or 2.

I have a filters set up for year/month. Currently they are pick(match()) depending on variable1. I'd like to just have another variable, and have the variable switch depending on whether variable1 is 1 or 2. So id like the variable to be something like if(Variable1 = 1,ShipMonth,FiscalMonth). This doesnt seem to work though.

Is this possible?

Labels (2)
2 Replies
Steven_Haught
Creator III
Creator III

Can you show how you are calculating your 1st variable? I have set a variable in another variable using $ expansion. I think that this could be a good solution here. 

kevin8
Contributor
Contributor
Author

I started by assigning the the first variable = 1 in the load script. I then use the supported variable extension and it can alternate between 1 and 2. I did try if($(Variable1) = 1,ShipMonth,FiscalMonth) and that errored out... I shouldve mentioned that.