

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to find today sales and last year same days sales?
Hi All,
How to find today sales vs last year same day sales

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Please see attached example of Year on Year.
Hope this helps you.
Kind Regards


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks guys..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi gireesh,
Last year sales:
SUM({<YourDateField = {'$(=Date(AddYears(Max(YourDateField),-1))'}>}Sales)
Today Sales:
SUM({<YourDateField = {$(=Today()}>}Sales)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Attached some working examples of suggestions made by others
Uses random number generator to generate data
and allows for selections on Days / Months

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
the previous same day calculation I am getting 0 and not the sales value with this formula.
Regards,
