2024 Jun 18 8:41 AM - edited 2024 Jun 18 8:47 AM
Hi everyone,
im just starting in the World of SAC and im trying to solve a thing i cant wrap my head around. Im sure i missed something or it isnt possible at all. Hope your're getting my problem and help me solve it 🙂
I have the requirement that plan values can be entered on a monthly basis in a form in a SAC story.
These should then be transferred to my model via a data action. Now I can easily write a value to the data. If I then call the dataaction repeatedly (12 or 6 times, depending on the scenario), it takes forever. Now I thought I could manage to enter the values as parameters in the data action
%ParameterPlanningValueJanuary%
%ParameterPlanningValueFebrurary%
...
a parameter like %ParameterStartDate% (Date, Single, Year, Month, Leaf) and %ParameterEndDate% to get the count of all the month to change and then write accordingly to the values to the month.
My working DA:
MEMBERSET [d/D_Accounts] = %ParameterAccount% //Sample -> ("571210") im Code "[D_Accounts].[parentId].&[500095]"
MEMBERSET [d/D_Cost_centers] = %tisParameterCostCenter% // Sample DE100
MEMBERSET [d/Date]= %tisParameterPlanningDate%
DATA([d/Measures] = "LC",
[d/D_Accounts] = %tisParameterAccount%,
[d/D_Cost_centers] = %tisParameterCostCenter%)
= %tisParameterPlanningValue%INTEGER @COUNT
INTEGER @I
@COUNT=DATEDIFF(%tisParameterStartDate%, %tisParameterEndDate%, "MONTH")
FOR @I= 0 TO @COUNT
//here i want to use a if like If I = 1 then write to January, if 2 then to February. Maybe to do it i also need to change I to a parameter aswell.
The values will be provided by the %ParameterPlanningValue[Month]% paramenters.
DATA([d/Measures] = "LC",
[d/D_Accounts] = %tisParameterAccount%,
[d/D_Cost_centers] = %tisParameterCostCenter%,
[d/Date]=NEXT(@I,"MONTH",%tisParameterStartDate%))= @ValueToInsert
ENDFOR
My Code in the scripting part
DataActionCostCenterPlanning_EntryForm.setParameterValue("ParameterCostCenter",DropDownCostCenterSelection.getSelectedKey());
DataActionCostCenterPlanning_EntryForm.setParameterValue("ParameterAccount", "[D_Accounts].[parentId].&["+DropDownAccountSelection.getSelectedKey()+"]");
DataActionCostCenterPlanning_EntryForm.setParameterValue("ParameterStartDate", "[Date].[YM].&[202401]");
DataActionCostCenterPlanning_EntryForm.setParameterValue("ParameterStartDate", "[Date].[YM].&[202406]");
DataActionCostCenterPlanning_EntryForm.setParameterValue("ParameterPlanningValueJanuary", ConvertUtils.stringToNumber(TextBoxValueJanuary.getValue()));
DataActionCostCenterPlanning_EntryForm.execute();
I hope I was able to explain my case clearly, if not please ask. 🙂
Thanks!
Mike
Request clarification before answering.
Hi @William_Yu1 here are some additional Screens to understand my problem better.
My Model:
My Story
My Form:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Correct, they should enter each value for the period / month to use it further.
Why it's not in regular table format but individual input field instead? Thats a good question probably because i didnt know better. Is there a way to use a table in that case? Can you point me in the direction that i try it out. Thank you.
Hi Mike-W,
I'm not sure about your use case. Whatever value user entered in the table is already stored in planning model. What do you want to achieve with data action?
Best regards, William
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.