cancel
Showing results for 
Search instead for 
Did you mean: 

Edit Date via Date Action

03-02-2026 10:18 PM
andreag412 Explorer
335 views 2 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Dear community,

I need to perform a Data Action on SAC using advanced formulas. I have the following model:

DIMENSION

  • Billing Date
  • Plan Date
  • Company
  • Liquidity Item

MEASURE

  • Payment Day
  • Amount

‘Billing Date’ (Day granularity), ‘Payment day’ (integer) ‘Plan Date’ (Day granularity set to 0000)

I need to calculate the Plan date as follows:

Plan Date = Billing Date + Payment Day

andreag412_0-1772486065898.png

 

I tried the NEXT formula, but without success. How can I achieve this desired result?

Thanks

SAP Analytics Cloud 

 

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

spurwar
Product and Topic Expert
Product and Topic Expert

Hi @andreag412 ,

you can try the below to generate the required data using data action. I am assuming the requirement is to copy the amount from billing date to payment date using the payment day measure and initial data is saved with no payment date.

Try using the below script to achieve the desired result.

INTEGER @DATE
FOREACH [d/Billing_Date]
@DATE = RESULTLOOKUP([d/Measures]="Paymnet_Day",[d/Payment_Date]="2026-01-01",[d/Audit]="Old")
DATA([d/Measures] = "Amount",[d/Payment_Date] = NEXT(@DATE,"DAY",[d/Billing_Date]),[d/Audit]="New") = RESULTLOOKUP([d/Measures]="Amount") 
ENDFOR

BEFORE

spurwar_0-1772517013651.png

AFTER

spurwar_1-1772517049117.png

Thanks

Shivam

 

 

andreag412
Explorer
Hi @spurwar, thanks for the help. In the end, I managed to do it too with a similar solution. Here's what I did: INTEGER @DAYS FLOAT @AMOUNT_VALUE FOREACH [d/Data_Fattura], [d/Company], [d/Liquidity_Item] @DAYS = RESULTLOOKUP([d/Measures] = "Payment_day") @AMOUNT_VALUE = RESULTLOOKUP([d/Measures] = "Amount") IF @DAYS > 0 THEN DATA([d/Data_Pianificazione] = NEXT(@DAYS, "DAY", [d/Data_Fattura]), [d/Liquidity_Item] = [d/Liquidity_Item],[d/Measures] = "Payment_day") = @DAYS DATA([d/Data_Pianificazione] = NEXT(@DAYS, "DAY", [d/Data_Fattura]), [d/Liquidity_Item] = [d/Liquidity_Item],[d/Measures] = "Amount") = @AMOUNT_VALUE ENDIF ENDFOR

Answers (0)