Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
How to find today sales vs last year same day sales
That depends on your data. You haven't given any information about that so we can't say. Try searching for an answer first: https://community.qlik.com/search.jspa?q=same+day+last+year
Hello Gireesh,
Hope you are doing well.
You can make use of Set Analysis feature. Please refer below given sample code.
// Expression to get the Today's Sales
Sum({$<OrderDate={$(=Today()}>}Sales)
Accordingly, you can replace the Today() function to get the same day of last year and retrieve the last year's sales.
Hope this will help.
Note: Use of this function will be limited to expression level. You can not use it at script level (Script level you can devise a SQL Script to get the data in two different cols i.e. Today's Sales & Past Year's Sales).
Thank you!
Rahul
Hi
Please see attached example of Year on Year.
Hope this helps you.
Kind Regards
Thanks
Thanks guys..
Hi gireesh,
Last year sales:
SUM({<YourDateField = {'$(=Date(AddYears(Max(YourDateField),-1))'}>}Sales)
Today Sales:
SUM({<YourDateField = {$(=Today()}>}Sales)
Today = 11/01/2017
If you want sales of Today and same Date last year use as below..
=SUM({<Date = {'$(=Today())'}>}Sales)
=SUM({<Date = {'$(=Date(AddYears(Today(),-1)))'}>}Sales)
If you want sales of Today(Wednesday) and last year same week Wednesday... use as below
=SUM({<Date = {'$(=Today())'}>}Sales)
=SUM({<Date = {'$(=Date(Today()-52*7))'}>}Sales)
Attached some working examples of suggestions made by others
Uses random number generator to generate data
and allows for selections on Days / Months
Hi,
the previous same day calculation I am getting 0 and not the sales value with this formula.
Regards,