Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have a doubt and I can not solve it, I want to create a variable that contains the selection of the month and then use it in a set analysis. I do the following:
variable: MESOB
value: getcurrentselection(mes)
set analysis: sum({<mesagenci={$(#MESOB)}>}objetivo)
But when used in set analysis returns null. Someone could help me clarify this doubt?
Hi Gabriel,
First: formats. What format have the mes field? Is it a text or a number?
Second: number of selections. How many selections are you doing using the field mes? If you select more than one value, it will be comma separated but not enclosed by single quotes, as required to a list of literal values. If you only select one value, again you need to use single quotes if the value is a text.
Third: Is the format of values in field "mesagenci" exactly the same as in field "mes"? If yes, are the both numeric? The "$(#MESOB)" will return a number (that's why you are using the "#" symbol in the dollar expansion) that might not match the format for the field "mesagenci".
I'd suggest you to use a slider object instead with all possible values for "mes" populating the variable "MESOB".
Hope that helps.
Miguel
Hi Miguel
Both are text, and a single selection.
I try to do this because the data model does not allow more key fields, and I can not thinkhow to
thanks
Hi Gabriel,
Then try the following
Sum({< mesagenci = {'$(MESOB)'} >} objetivo)
Note that the variable is now single quoted and the "#" has been removed.
Hope that helps
Miguel
Hi Miguel
It works, but now the result is numeric, 0.
I created 2 objects slider, one month and another with the variable, the result of months is correct but the variable is a range of 0 to 10.
There may be declared wrong the value of the variable?
Thanks
Sorry, I said it works, but is not working properly
Hi Gabriel,
Check this application where a variable is used to populate the month and then used in a set analysis.
Hope that helps.
Miguel
Gabriel, check the post above and see if you can do something similar. It's using a variable for month with a numeric value populated by a slider object and a set analysis using that variable.
Miguel
Thanks Migul.
I will continue working on it
regards