Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have Date field in my data model and I am using below expression to get the sales but unfortunately it's not working
Format of Date field is DD-MM-YYYY
=sum({<Date={"$(=max(Date))"}>}Sales)
May be your date is in text format. try to convert it in Date format by
date(date#(YourDateField,'DD-MM-YYYY'),'DD-MM-YYYY') as Date then use your expression
or use below expression
sum({<Date={"$(=max(date#(Date,'DD-MM-YYYY')))"}>}Sales)
=sum({<Date={"$(=max(date(date#(Date,'DD-MM-YYYY'),'DD-MM-YYYY')))"}>}Sales)
May be your date is in text format. try to convert it in Date format by
date(date#(YourDateField,'DD-MM-YYYY'),'DD-MM-YYYY') as Date then use your expression
or use below expression
sum({<Date={"$(=max(date#(Date,'DD-MM-YYYY')))"}>}Sales)
=sum({<Date={"$(=max(date(date#(Date,'DD-MM-YYYY'),'DD-MM-YYYY')))"}>}Sales)
you need the same format as your Date field also for the right part, DD-MM-YYYY, add a Date formatting function;
if your date format (SET DateFormat='DD-MM-YYYY'; at the beginning of the script is DD-MM-YYYY just the Date function
=sum({<Date={"$(=Date(max(Date)))"}>}Sales)
if your date format (SET DateFormat='DD/MM/YYYY'; at the beginning of the script isn't DD-MM-YYYY the Date function with the format DD-MM-YYYY
=sum({<Date={"$(=Date(max(Date)), 'DD-MM-YYYY')"}>}Sales)
Thanks a lot ,your guess was correct. Date field was in text format. I didn't recognize. My bad.
thanks maxgro for your response. It is helpful but unfortunately will not help as Date was in text format.