on 2025 Mar 04 7:18 AM
Hello,
I need to find out the difference between to dates. However these dates are not properties but actual income and outgoing transactions.
I separated them into 3 measures (income outgoing and difference), but I can't change these into accounts or create a generic dimension if that's the best practice. I have only one time dimension, also here I can create few time dimensions if that's the best practice. let me know your thoughts.
in the below example the result I'm looking for is Jan 6th minus Jan 4th = 2 days
I made several trials with INTEGER or VARIABLEMEMBER (like below) no one worked.
example of a failure:
VARIABLEMEMBER #INCOME OF [d/Date]
VARIABLEMEMBER #OUTCOME OF [d/Date]
FOREACH [d/IL_D_POC_RPD_STATUS]
IF RESULTLOOKUP([d/Measures]="Income", [d/IL_D_POC_RPD_STATUS]="STS_023") > 0 THEN
DATA([d/Measures]="Income",[d/Date]=#INCOME)=RESULTLOOKUP()
ENDIF
IF RESULTLOOKUP([d/Measures]="Outgoing", [d/IL_D_POC_RPD_STATUS]="STS_023") > 0 THEN
DATA([d/Measures]="Outgoing", [d/Date]=#OUTCOME)=RESULTLOOKUP()
ENDIF
ENDFOR
DATA([d/Measures]="Time_deviation",[d/Date]="2025-01-01") = DATEDIFF(#INCOME, #OUTCOME, "DAY")
thanks!
Request clarification before answering.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Deb_D
I'm no real Data Actions expert... but checking the SAC Help page I'm wondering a bit that your variables start with # instead are %Income% and %Outcome% ?
Example there: @DiffMonth = DATEDIFF(%EndDate%, TODAY(), "MONTH")
Maybe it helps? Otherwise you really need an expert here 😅
BR, Martin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 14 | |
| 8 | |
| 6 | |
| 6 | |
| 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.