on 11-10-2010 5:59 PM
Hello:
I want to pass dynamic values from prompt to script logic:
*XDIM_MEMBERSET INDICADORES=PORDIST,NAINDI,PORAJU,PORTOTAL
*XDIM_MEMBERSET LINEA=NALINEA
*WHEN INDICADORES
*IS PORDIST,PORAJU,PORTOTAL
*FOR %YEAR% = %anio%
*FOR %MONTH% = JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC
*REC(FACTOR=-1, TIEMPO="%YEAR%.%MONTH%")
*NEXT
*NEXT
*ENDWHEN
*COMMIT
My variable is %anio%... If the user insert 2010 in the prompt, i Want 2010 to be there.
How can I do this?
This my package:
DEBUG(ON)
PROMPT(RADIOBUTTON,%CHECKLCK%,"Select whether to check work status settings when running logic.",1,{"Yes, check for work status settings before running logic","No, do not check work status settings"},{"1","0"})
PROMPT(TEXT,%anio%,"Elegir año",,"")
TASK(Execute formulas,USER,%USER%)
TASK(Execute formulas,APPSET,%APPSET%)
TASK(Execute formulas,APP,%APP%)
TASK(Execute formulas,SELECTION,%SELECTIONFILE%)
TASK(Execute formulas,LOGICFILE,%APPPATH%..AdminApp%APP%Copy - NA-Month.lgx)
TASK(Execute formulas,FORMULASCRIPT,"*FUNCTION LOGICPARAM=%anio%|")
TASK(Execute formulas,RUNMODE,1)
TASK(Execute formulas,LOGICMODE,1)
TASK(Execute formulas,CHECKLCK,%CHECKLCK%)
The error Messa ge is: Invalid Selection%
Thanks in advance
Luciana
Hi Luciana,
Have a look at my answer in the following post:
You should get the general idea. If not, let me know.
Thanks,
John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Luciana,
There are 2 problems in the advanced script.
First is that %SELECTIONFILE% is a temporary file which stores members of dimensions selected while executing DM. For populating these values, we need to use SELECTINPUT statement. However, you are not prompting to select any member of any dimension. Thus, your %SELECTIONFILE% is empty. So, you can remove this statement.
Secondly, you have prompted to enter a text. However, there is no statement to pass this variable to your script.
To keep it simple, you can prompt the user to select a time member using the prompt statement with SELECTINPUT. Once the user slects this, this value will be stored in the %SELECTIONFILE%. Your script can fetch the year value by using %YEAR% variable.
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
As your selection is the year from the time entered.
for that you have to maintain the "year" property in time dimension.
and by the selection statement you can have the year in variable.
*selection(%year1%,[ID],TIME,"ID = '%TIME_SET%'")
%year1% holds your year value in the above scinario
thanks,
Rajesh
The error message is:
Execute formulasError
Invalid selection passed:
%SELECTIONFILE%
Thanks,
Luciana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Luciana,
You have not used %DIMS% or SELECTINPUT or any option(with %DIMENSION_DIM%) to select members directly from the dimension member list. You have used a Text option to receive the input user. So nothing will be there in the SELECTION FILE. You must remove that line to avoid that error.
Karthik AJ
User | Count |
---|---|
14 | |
4 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.