Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have the data sample and expected result like this:
I used:
If(Flag_This_Year = 1, Date) for the dimension,
Sum({<Date ={"$(=AddYears(Max(Date),-1))"}>}Sales) for measure sale last year, but got wrong result.
I know that it can be done with join function in data load script, I am looking for a solution on dashboard.
Any help would be greatly appreciated.
hi Quy You are restricting the Dimesnion field i.e If(Flag_This_Year = 1, %Date) lasy year will show "0" sales
Hi Vishal,
Thanks for your reply. So could you please guide me how to achieve the result table?
Could you tell me the Expected Result So i can change the expression!
Expected result is the picture in the original post
Hi,
try below logic
Table1:
Load * from table1;
Noconcatenate:
Current_year_Data:
Load date as year_date,
sales as this_year_sales
Resident Table1
where flag_this_year=1;
join
Load date(AddYear(date,1)) as year_date,
sales as prev_year_sales
Resident Table1
where flag_this_year=0;
In front end
take straight able
dimension
year_date
Expression:
1: sum(this_year_sales)
2: sum(prev_year_sales)
Regards,
Thanks for your reply, i am looking for a solution in front end without changing script. Is it possible?
I guess you can't.
Thanks Rajesh, but i want to view data by date, not by month. I got 60 dates in 2 months of 2017 and 60 dates in the same months of 2018.