Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a data model that uses canonical dates as shown in the attached file.
But I have a problem after implementing it.
I'm trying to get the numbers for previous year same date but I get zero, not sure if doing it right. I guess it doesn't get the values for previous year as the current year is selected.
Is there a way to get the corresponding value of the same day previous year?
ex: if leads =20 on 10-sep-2018, leads = ?? on 10-sep-2017
Here is the expression i have used:
This current date works:
sum({<DateType={"LeadMarketCreatedDate"}, Date={">=$(vDateFrom) <=$(vDateTo)"}>} LeadFlag)
But this doesn't work:
=sum({<DateType={"LeadMarketCreatedDate"}, Date={">=$(vDateFrom_1) <=$(vDateTo_1)"}>} LeadFlag)
vDateFrom_1 is: num((Date(AddYears(min(Date), -1))))
vDateTo_1 is: num((Date(AddYears(max(Date), -1))))
Help is greatly appreciated
Hi,
Just one check, you should neglect all the Calendar Related fields in set analysis while trying to get the previous year data with current years selection.
Do in your case the expression should look like below.
=sum({<DateType={"LeadMarketCreatedDate"}, Date={">=$(vDateFrom_1) <=$(vDateTo_1)"},Year=,Month=,Week=>} LeadFlag)
Replace the Bold Field names with your actual field names.
Regards,
Kaushik Solanki