on 2025 May 13 10:59 AM
Hello Experts,
Context:
We are trying to achieve copy the data from Account based model to Measure base through link function but are facing some glitch in code.
Issue:
Code:
The below code is written to served the purpose but it is copying the Default currency data of old model to Local currency of new model. Moreover i don't see where the linkage for the measure can be given as source model doesn't have measure.
Request you to please provide your expert comments on the same.
**
MEMBERSET [d/Accounts] = BASEMEMBER([d/Accounts], "Rate", "Quantity", "Input",)
MODEL [Model_Old]
MEMBERSET [d/Date] = BASEMEMBER([d/Date], %DateN%)
MEMBERSET [d/Accounts] = BASEMEMBER([d/Accounts], "Rate", "Quantity", "Input",)
ENDMODEL
DATA(
[d/Accounts] = [Model_Old].[d/Accounts],
[d/Date] = [Model_Old].[d/Date])
= LINK([Model_Old], [d/Version] = %SourceVersion%)
****
Regards,
Request clarification before answering.
Hi @9160ruby
When cross-model copy from the Account model to the Measure model, the default currency value is copied. There is no way to copy from the "Local currency value" of the Account model to the Measure model.
The workaround solution is to convert from the default currency value to the Local currency on the measure model.
DATA([d/Measures] = "USD", [d/Accounts] = [Model_Old].[d/Accounts], [d/Date] = [Model_Old].[d/Date])
= LINK([Model_Old], [d/Version] = %SourceVersion%)
I hope this is helpful to you, and if I have misunderstood anything, please feel free to reach out.
Moonjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @9160ruby
Unfortunately, there is no single solution to migrate from the Old model to the New model for Local currency value.
Moonjun
Hi MoonJun,
I have tried the workaround which you have propose but there seems to be decimal difference compare to the old Local Value. I have provided an numbers of old model as well as new .
Old model | LC | GC | |
149519.099 | 40964.1363026 | ||
9351.0445 | 2561.9299743 | ||
New | LC | Amount in GC | |
149519.09899960 | 40964.136302600 | ||
9351.04449970 | 2561.92997430 | ||
Is there any possibility that SAC does backend some roundup and hence this is something came up. Request you to provide your opinion to tackle the same
Regards,
Hi @9160ruby
The LC value in the old model appears to be a 4-decimal-place value, while the conversion rate seems to be a 7-decimal-place value. As a result, the GC value (1.Conversion) in the old model was calculated with 7 decimal places, and the same 7-decimal-place value was copied (2.Copy - Link) to the GC in the new model. The GC value (3.Conversion) in the new model is computed using the 7-decimal-place LC value and rate, which causes a difference compared to the LC value in the old model. Please refer to the screenshot below for the calculation flow.
SAC calculates values with 7 decimal places as the default setting.
Regards,
Moonjun
Hi @MoonJun, Yeah i got the same sense as rate is considered "0.2739726" Is there any possibility to perform the rounding after Currency translation to the certain digits.
Hi @9160ruby
You already created a Data action for Currency conversion step, please add one more Script step with the below Advanced formulas script.
MEMBERSET [d/Measures] = "LC"
DATA() = ROUND(RESULTLOOKUP(), 4)
Regards,
Moonjun
User | Count |
---|---|
30 | |
21 | |
16 | |
8 | |
7 | |
6 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.