Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good day
I have the following calculations on my set analysis:
sum({<L_WRITTEN_OFF_L3M_IND={'Y'}, L_CREDIT_DEBIT_IND={'DB'},L_NCA_PRODUCT_CODE={'UNL'}, L_NCA_IND={'J','Y','X'}>}[L WRITTEN OFF AMOUNT])
Now I want to use this set to calculate for the last three months.
Your assistance will be highly appreciated.
Kind regards,
Mbini
Make sure that Your Date field is not the string, to check this create the Text object and put the expression "=max(Date)", if you get '-' means it is not in Date format, if you get the Values , it means it is in Date format.
If it is not in Date format, use Date# function to make it in Date format, then use below expression
sum({<
L_WRITTEN_OFF_L3M_IND={'Y'},
L_CREDIT_DEBIT_IND={'DB'},
L_NCA_PRODUCT_CODE={'UNL'},
L_NCA_IND={'J','Y','X'},
Date ={">=$(=addmonths(max(Date),-3)) <=$(=max(Date))"}>} [L WRITTEN OFF AMOUNT])
create a variable like vMonStart = monthstart(addmonths(datefield,-3))
vMonEnd = dateField
sum({<L_WRITTEN_OFF_L3M_IND={'Y'}, L_CREDIT_DEBIT_IND={'DB'},L_NCA_PRODUCT_CODE={'UNL'}, L_NCA_IND={'J','Y','X'},DateFeild ={'>=$(vMonStart ) <=$(vMonEnd )'}>}[L WRITTEN OFF AMOUNT])
Regards
$@M.
What is this Flag L_WRITTEN_OFF_L3M_IND?
yes its a flag
So is this Last 3 months Flag?
its a flag that checks if its been written off in the last three months
my datefiled is 'Date'
Define the variables: ( I always do this in the load, but you can use the variable overview as well):
Set vPeriodStart = '=AddMonths(Max(Date))';
Set vPeriodStart = '=AddMonths(Max(Date), -3)';
Set vPeriodEnd = '=Date(Max(Date))';
Then use the expression:
sum({<
L_WRITTEN_OFF_L3M_IND={'Y'},
L_CREDIT_DEBIT_IND={'DB'},
L_NCA_PRODUCT_CODE={'UNL'},
L_NCA_IND={'J','Y','X'},
Date ={">=$(vPeriodStart) <=$(vPeriodEnd)'}>} [L WRITTEN OFF AMOUNT]
)
Try this
sum({<L_WRITTEN_OFF_L3M_IND={'Y'}, L_CREDIT_DEBIT_IND={'DB'},L_NCA_PRODUCT_CODE={'UNL'},L_NCA_IND={'J','Y','X'},DATEFIELD={">=$(=MonthStart(max(DATEFIELD),-3))<=$(=max(DATEFIELD))"}>}[L WRITTEN OFF AMOUNT])
I have tried this, I get a negative value