Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have the following expression which returns the results from the last 7 days from a date range selected by the user:
NUM(Sum({[DateCompare]<TestFlag={'Live'}, RefundOrSale={'Sale'},[Level 7]=$::[Level 7],[Level 2]-={'System/Refund','PAYG Pop card'},Date={">$(=Date(Max(Date)-7))<=$(=Max(Date))"}>} MonetaryValue),'£0,000')
This works great and other expressions without the " Date={">$(=Date(Max(Date)-7))<=$(=Max(Date))"} " means I can show total selection and last 7 days in the same report. Great.
Problem is my use of Alternate States. I have Date in a separate state called "DateCompare". The expression above ignores the Date selection in DateCompare and looks at the default state. I've tried replacing the $ with [DateCompare] but no luck.
Can anyone help with the expression so that the "last 7 dates" refers to the alternate state?
Thank you
Alex
May be try this:
Num(Sum({[DateCompare]<TestFlag={'Live'}, RefundOrSale={'Sale'},[Level 7]=$::[Level 7],[Level 2]-={'System/Refund','PAYG Pop card'},Date={">$(=Date(Max({DateCompare}Date)-7))<=$(=Max({DateCompare}Date))"}>} MonetaryValue),'£0,000')
May be try this:
Num(Sum({[DateCompare]<TestFlag={'Live'}, RefundOrSale={'Sale'},[Level 7]=$::[Level 7],[Level 2]-={'System/Refund','PAYG Pop card'},Date={">$(=Date(Max({DateCompare}Date)-7))<=$(=Max({DateCompare}Date))"}>} MonetaryValue),'£0,000')
Try
NUM(Sum({[DateCompare]<TestFlag={'Live'}, RefundOrSale={'Sale'},[Level 7]=$::[Level 7],[Level 2]-={'System/Refund','PAYG Pop card'},Date={">$(=Date(Max({DateCompare} Date)-7))<=$(=Max({DateCompare}Date))"}>} MonetaryValue),'£0,000')
Thank you, works brilliantly.
Thank you, it works.