Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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,
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])
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])
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.
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?
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!
Not a problem, I am glad we have found the issue
Is your variable defined with a leading equal sign or without?
If there is no leading equal sign, try to add one.
Try removing the single quotes from the expression:
Sum({$<TranType = {$(vTRLV)}>} [Actual Sales])
Miguel Gavidia