on 09-02-2016 6:05 PM
Hi All,
I have developed a script logic (RECLASS) , which I want to run only when a property of TIME dimension ( DAY_YEAR) has value "R" in it. This value could be under any TIME ID.
Below syntax is not working, but will give you an idea of what I am trying to accomplish. Does anyone know how to achieve following with correct syntax?
*SELECT(%Z%,"ID","TIME","[DAY_YEAR] = "R"")
*WHEN %Z%
*IS <> " "
*INCLUDE RECLASS.LGF
*ENDWHEN
Thanks,
S
Sorry. but absolutely not clear what do you want to achieve: "when a property of TIME dimension ( DAY_YEAR) has value "R" in it"
What member of time dimension????
And the syntax is incorrect...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vadim,
What I am checking is that there should be a value R assigned to property DAY_YEAR of time dimension. It doesn't matter which time period it is assigned to. I want to execute a script only if there is R in the property. If none of the time members has DAY_YEAR property marked as R , then I don't want to run the logic.
I pasted incorrect syntax just to show what I want to accomplish. Here is dummy logic
IF any member of time dimension has DAY_YEAR Property =R
then Run RECLASS script
Otherwise do nothing.
or
Following is my RECLASS script which I don't want to execute if DAY_YEAR property does't have R value in any period. I am passing Time period through DM package.
*XDIM_MEMBERSET FSI = FSI1030100, FSI1120100, FSI1120200, FSI2012420, FSI2012435, FSI2012425
*XDIM_MEMBERSET CATEGORY = ACTUAL
*XDIM_MEMBERSET SCOPE = S_NONE
*XDIM_MEMBERSET AUDITTRAIL = AT_ICDIFF
*XDIM_MEMBERSET FLOW = F_ICDIFF
*SELECT(%C%,"ID","TIME","[DAY_YEAR] = "R"")
*WHEN TIME
*IS < %C%
*REC(EXPRESSION = 0)
*ENDWHEN
Thanks,
S
"I am passing Time period through DM package." then TIME periods will be in %TIME_SET%
"I want to execute a script only if there is R in the property"
Your script will be:
*XDIM_MEMBERSET FSI = FSI1030100, FSI1120100, FSI1120200, FSI2012420, FSI2012435, FSI2012425
*XDIM_MEMBERSET CATEGORY = ACTUAL
*XDIM_MEMBERSET SCOPE = S_NONE
*XDIM_MEMBERSET AUDITTRAIL = AT_ICDIFF
*XDIM_MEMBERSET FLOW = F_ICDIFF
*XDIM_MEMBERSET TIME=%TIME_SET%
*WHEN TIME.DAY_YEAR
*IS R
*REC(EXPRESSION = 0) //only for members with R
*ENDWHEN
Vadmin,
Thanks for your effort in trying to help me:
I do not want to run the script either for periods with R or without R, but I want to run script only when there is any R. e.g R is marked on 2015.03, and I pass 2014.01 to DM package, then I would like to run script on 2014.01
If there is no R in any period, and I pass 2014.01 then I don't want to run the script.
Hope this clarifies what I am looking for
Thanks,
S
Assuming that multiple periods can be marked by R (all - base members) then the following code will simulate if:
*SELECT(%C%,CALC,TIME,DAY_YEAR=R) //%C% will contain one or more "N" or Empty
*SELECT(%P%,ID,TIME,CALC=%C% AND ID=2010.01) //%P% will contain 2010.01 or Empty
*FOR %T%=%P%
//Your code here - If %P% is empty - not executed!
*NEXT
Vadin,
For statement gave me idea to use the following code. Thanks for that. Now the code will not run if "R" is not assigned to a period.
Next thing to solve in the code is to not run it if "R" is assigned to more than one period. I want to run code only when only one period is marked as R and this period could be any period.
Do you have any suggestion on that?
*XDIM_MEMBERSET FSI = FSI1030100, FSI1120100, FSI1120200, FSI2012420, FSI2012435, FSI2012425
*XDIM_MEMBERSET CATEGORY = ACTUAL
*XDIM_MEMBERSET SCOPE = S_NONE
*XDIM_MEMBERSET AUDITTRAIL = AT_ICDIFF
*XDIM_MEMBERSET FLOW = F_ICDIFF
*XDIM_MEMBERSET TIME = %TIME_SET%
*SELECT(%C%,"ID","TIME","[DAY_YEAR] = "R"")
*FOR %L% = %C%
*WHEN TIME
*IS < %L%
*REC(EXPRESSION = 0)
*ENDWHEN
*NEXT
*COMMIT
Thanks,
S
For 3 conditions:
*SELECT(%T%,TIMEID,TIME,DAY_YEAR=R)
*SELECT(%P%,ID,TIME,TIMEID<=%T% AND CALC=N)
*SELECT(%C%,ID,TIME,ID=%P% AND TIMEID>=%T% AND CALC=N)
*FOR %L%=%C%
/Your code here - If %C% is empty - not executed!
*NEXT
If 2 or more members are marked with R %C% will be empty.
If none is marked with R %C% will be empty.
If single member marked with R %C% will contain the ID of this member
Sorry, please test again!
Use code like here (XDIM_MEMBERSET in the loop just to check)
*SELECT(%T%,ID,TIME,DAY_YEAR=R)
*SELECT(%P%,ID,TIME,ID<=%T%)
*SELECT(%C%,ID,TIME,ID=%P% AND ID>=%T%)
*FOR %L%=%C%
//Your code here - If %C% is empty - not executed!
*XDIM_MEMBERSET TIME=%L%
*NEXT
It's 100% consistent, just tested with 3 members marked with R:
*SELECT(%T%,ID,TIME,DAY_YEAR=R)
%T%=2015.05,2015.07,2015.10
*SELECT(%P%,ID,TIME,ID<=%T%)
%P%=...2015.04,2015.05
ID>=%T% - 2015.10,2015.11,2015.12...
*SELECT(%C%,ID,TIME,ID=%P% AND ID>=%T%)
%C% - empty
Only with single member marked by R
%T%=2015.05
*SELECT(%P%,ID,TIME,ID<=%T%)
%P%=...2015.04,2015.05
ID>=%T% - 2015.05,2015.06,2015.07...
*SELECT(%C%,ID,TIME,ID=%P% AND ID>=%T%)
%C%=2015.05
Vadin,
I think following syntax gives all the periods in %P% or >=%T%. I think because AND condition is not valid when both properties are same ( ID in this case ) . In such cases AND behaves like OR
*SELECT(%C%,ID,TIME,ID=%P% AND ID>=%T%)
I testes this in UJKT and seems AND is not working.
Thanks,
Sanjeev
User | Count |
---|---|
15 | |
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.