Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have used the below expression to calculate the amount starting from financial year to this date. But, When I try to change the date in the filters, the below expression doesn't work.
For example;
If I select date as 01/05/2017 in the filter, The report should list the values starting from 01/04/2017 to 01/05/2017 but instead it calculates all the values from 01/04/2017 to today.
I have used the below expression in my report;
=Sum({<Dim_Date={'>=$(=YearStart(Max(Dim_Date),0,4)) <=$(=Max(Dim_Date)))'}>}Amount)
What so strange here is when I put the start date in one text box and end date expression in one text box and then I select the date in filters, The dates are changing in the text boxes.
Please help me to fix this issue.
You must declare the Variable name like
=Sum({<Dim_Date={'>=$(=YearStart(Max(Dim_Date),0,4)) <=$(DateRangeVariableName)'}>}Amount)
OR
=Sum({<Dim_Date={'>=$(=YearStart(Max(Dim_Date),0,4)) <=$(=Max(Dim_Date)))'}>}Amount)
May be one extra parenthesis written
Hi Anil,
Thanks for the reply.Again I'm having the same problem. Is there any other simpler way to solve this. The Date inside the expression should change as I change the date in the filters, Also the year function too should work.
Can you please attach work file to test
Try below one
Sum({$<
Dim_Date={">=$(=MonthStart(AddMonths(Max(Dim_Date),-1)))<$(=MonthEnd(Max(Dim_Date)))"}>}Amount)
How about if you use Date() function
=Sum({<Dim_Date = {"$(='>=' & Date(YearStart(Max(Dim_Date), 0, 4), 'DD/MM/YYYY') & '<=' & Date(Max(Dim_Date), 'DD/MM/YYYY'))"}>} Amount)