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

How to find today sales and last year same days sales?

Hi All,

How to find today sales vs last year same day sales

9 Replies
Gysbert_Wassenaar

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


talk is cheap, supply exceeds demand
rahulpawarb
Specialist III
Specialist III

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

Not applicable

Hi

Please see attached example of Year on Year.

Hope this helps you.

Kind Regards

gireesh1216
Creator II
Creator II
Author

Thanks

gireesh1216
Creator II
Creator II
Author

Thanks guys..

Not applicable

Hi gireesh,

Last year sales:

SUM({<YourDateField = {'$(=Date(AddYears(Max(YourDateField),-1))'}>}Sales)


Today Sales:


SUM({<YourDateField = {$(=Today()}>}Sales)



MK_QSL
MVP
MVP

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)

ruanhaese
Partner - Creator II
Partner - Creator II

Attached some working examples of suggestions made by others

Uses random number generator to generate data

and allows for selections on Days / Months

rahulsingh12
Contributor III
Contributor III

Hi,

the previous same day calculation I am getting 0 and not the sales value with this formula.

 

Regards,