Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
New-Qlik
Creator II
Creator II

Comparing This week profit with LY this week profit wrt same no of days

Hello.

I want to compare this week data with LY same week data  but not full last year week

Like this week we have data till yesterday i.e 2020-03-18 (Wednesday) so for Last year it should show data till Wednesday only. 

2 Replies
bharadwaj
Partner - Contributor II
Partner - Contributor II

Hi,

This can be achieved by creating four variables as follows:

Variable 1:   weekstart(max(Date).                                   

Variable 2: Max(Date)

Variable 3:   Addyears(weekstart(max(Date),-1)       

  Variable 4: Addyears(Max(Date),-1)

Now we can use these variables in set analysis and compare this year's current week trend and last year's current week trend.

e:g: For Current Year current week:- Sum({<Date={">=$(Variable1)<=$(Variable2)"}Sales)

        For Last Year Current Week :- Sum({<Date={">=$(Variable3)<=$(Variable4)"}Sales).

I used Variables because those can be re used,if you want you can use the direct expressions instead of variables in the set analysis.

Hope it helps

Thanks & Regards...!!!

 

New-Qlik
Creator II
Creator II
Author

Thanks for replying . Some how variables are correct but set analysis is not working it gives zero which is wrong