Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Below is my original set expression:
=sum({<Year={$(vPriorYear)}, TRANSACTION_DATE={'>=$(=YearStart(max(TRANSACTION_DATE),-1))<=$(=AddYears(max(TRANSACTION_DATE),-1))' }>} NTPV_AMT)
Now I want to add one more condition on TRANSACTION_DATE,
TRANSACTION_DATE={'>=$(=Date(date(max(TRANSACTION_DATE)-(vDays))))<=$(max(TRANSACTION_DATE))'}
I tried doing it with AND but it didn't work.
=sum({<Year={$(vPriorYear)}, TRANSACTION_DATE={'>=$(=YearStart(max(TRANSACTION_DATE),-1))<=$(=AddYears(max(TRANSACTION_DATE),-1))' AND
'>=$(=Date(date(max(TRANSACTION_DATE)-(vDays))))<=$(max(TRANSACTION_DATE))'
}>} NTPV_AMT)
Any suggestions or help on how to achieve it.
--Sachin
Can you try this:
=Sum({<Year={$(vPriorYear)}, TRANSACTION_DATE = {
'>=$(=YearStart(Max(TRANSACTION_DATE),-1))<=$(=AddYears(Max(TRANSACTION_DATE),-1))',
'>=$(=Date(Date(Max(TRANSACTION_DATE)-(vDays))))<=$(Max(TRANSACTION_DATE))'
}>} NTPV_AMT)
Give the below a try:
=sum({<Year={$(vPriorYear)}, TRANSACTION_DATE={'>=$(=YearStart(max(TRANSACTION_DATE),-1))<=$(=AddYears(max(TRANSACTION_DATE),-1))' ,
'>=$(=Date(date(max(TRANSACTION_DATE)-(vDays))))<=$(max(TRANSACTION_DATE))'
}>} NTPV_AMT)
Try adding a new field in the script ..
num(floor(TRANSACTION_DATE)) as TRANSACTION_DATE_NUM
and this..see the brackets...
TRANSACTION_DATE_NUM={'>=$(=max(TRANSACTION_DATE_NUM)-(vDays))<=$(=(max(TRANSACTION_DATE_NUM))'}
Didn't work Sunny.
It didnt' work, Thirumala..
Hi Phanee,
I already had a field, num(TRANSACTION_DATE) as TRANSACTION_DATE_NUM, but it didn't work.
So now I'm changing it to num(floor(TRANSACTION_DATE)) as TRANSACTION_DATE_NUM
Will try again and see.
Are the two set expressions working stand alone?
Yes, they are..
What are the values you are getting when you run the two set expressions individually?