Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

date variable

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?

8 Replies
Miguel_Angel_Baeyens

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

Not applicable
Author

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

Miguel_Angel_Baeyens

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

Not applicable
Author

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

Not applicable
Author

Sorry, I said it works, but is not working properly

Miguel_Angel_Baeyens

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

Miguel_Angel_Baeyens

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

Not applicable
Author

Thanks Migul.


I will continue working on it


regards