Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm looking for a possibility to compare the current selected day values (e.g. sales )to the last years day (sales).
Because of some sepcial demands I have already a time table with the date_of_day and a second column last_year_day.
How can I build such a function in a metric expression ?
I guess set analysis, but I can't get it working.
Thank you !
What type of filter does the user select? Calendar dates? Months? Days in numbers?
Karl
It's a calendar date and the last_year_date column is also type date.
It's easier if you have separate year, month, day columns, but the following set analysis worked for me when the filter was a complete calendar date.
sum({$<Date={$(=chr(39) & concat(distinct makedate(year(Date)-1,month(Date),day(Date)),chr(39)&','&chr(39))&chr(39))}>} Sales)
The chr(39) are single quotes around the dates.
Karl
Thanks a lot !
But would it also be possible to use a different already created last year date in a separate table colmun last_year_day ?
I had a feeling you might ask that. It should work if you adjust the expression to something like:
sum({$<Date={$(=chr(39) & concat(distinct last_year_day,chr(39)&','&chr(39))&chr(39))}>} Sales)
How can I compare the below dates?
1/5/2012 Thursday
to
1/6//2012 Thursday