Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
asmithids
Partner - Creator II
Partner - Creator II

Variable Not Expanding in Set Analysis

Hello,

I have the folllowing set expression that uses a variable to retrieve the text I'm looking for in the set modifier.

Set Expression:  Sum({$<TranType = {'$(vTRLV)'}>} [Actual Sales])

Variable: vTRLV = GetFieldSelections(zPerspective)

The values in the zPerspective field are the following.

  • LV
  • TR

I have a text box with =$(vTRLV) that does display either the LV or TR when I select a parameter in the zPerspective List Box. However, the variable in the set expression above is not expanding to the selected parameter.  The set expression does work when I hard code the set modifier with either 'LV' or 'TR'. 


I'm not seeing where I'm dropping the ball.


Any help will be very much appreciated! 


Thank you,


1 Solution

Accepted Solutions
sunny_talwar

I don't see why you need this variable, by default if you model is connected properly the selections will filter the expression. But if you still want to this for some reason, then try this:

Variable: vTRLV = Chr(39) & GetFieldSelections(zPerspective, Chr(39) & ',' & Chr(39)) & Chr(39)

Sum({$<TranType = {$(vTRLV)}>} [Actual Sales])

View solution in original post

7 Replies
sunny_talwar

I don't see why you need this variable, by default if you model is connected properly the selections will filter the expression. But if you still want to this for some reason, then try this:

Variable: vTRLV = Chr(39) & GetFieldSelections(zPerspective, Chr(39) & ',' & Chr(39)) & Chr(39)

Sum({$<TranType = {$(vTRLV)}>} [Actual Sales])

asmithids
Partner - Creator II
Partner - Creator II
Author

Hi Sunny,

Still not working.  Not getting any values in the set expression.  I do see the difference in the variable.  It is now showing the quotes around the value.

Based on your response, the model is connected properly.  Don't see how the selections will filter in the expression. 

sunny_talwar

GetFieldSelections usually get the value of what is being selected. If your expression is not restricted using {1<>} (one) it is suppose to filter based on selection. Why do you need to explicitly do the same thing? The only time it won't work is if the field is not connected to the chart dimensions. Does it make sense?

asmithids
Partner - Creator II
Partner - Creator II
Author

Makes sense.  Thanks.  I checked the data model and see that the zPerspective field is not connected to the model.  I inherited this app and are dealing with an extremely poor data model.  I'll see what I can do to connect the field to the model.

Thanks for your help! 

sunny_talwar

Not a problem, I am glad we have found the issue

swuehl
MVP
MVP

Is your variable defined with a leading equal sign or without?

If there is no leading equal sign, try to add one.

mgavidia
Creator
Creator

Try removing the single quotes from the expression:

Sum({$<TranType = {$(vTRLV)}>} [Actual Sales])

Miguel Gavidia