Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
nareshthavidishetty
Creator III
Creator III

Today's date vs last year same date calculation

Hi,

I need to calculate the sum(sales) for today's date vs last year same date.

Like today's date (2/28/2017 ) sales is 222 and i need to compare the sales for 2/28/2016

Date field: Solddate

Logic: sum(sales)

Thanks..

8 Replies
Anonymous
Not applicable

       Sum({$<Solddate={"$(=Date(AddYears(Max(Solddate), -1), 'MM/DD/YYYY'))"}>} Sales )

Anil_Babu_Samineni

Use below condition on your Set analysis

2/28/2017

Sum({<Date = {'$(=Today())'}>}Sales)

2/28/2016

Sum({<Date = {'$(=AddYears(Today(),-1))'}>}Sales)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
nareshthavidishetty
Creator III
Creator III
Author

Hi,

I need to get this as dynamic like if i select 2013 the sales is comparative in the chart like 2/28/2013 sales vs 2/28/2012.

Thanks..

Anonymous
Not applicable

i think the below should be working as dynamic !!!

this year

Sum({$<Solddate={"$(=Date((Max(Solddate)), 'MM/DD/YYYY'))"}>} Sales )

previous year

Sum({$<Solddate={"$(=Date(AddYears(Max(Solddate), -1), 'MM/DD/YYYY'))"}>} Sales )

nareshthavidishetty
Creator III
Creator III
Author

Hi ,

The below logic alone is not working.

Logic: Sum({$<Solddate={"$(=Date((Max(Solddate)), 'MM/DD/YYYY'))"}>} Sales )

Thanks..

Anonymous
Not applicable

may be check with your  Sales  ,  or  sales  , or  SALES..

try to change as below ..

Sum({1<Solddate={"$(=Date((Max(Solddate)), 'MM/DD/YYYY'))"}>} sales )

Sum({1<Solddate={"$(=Date(AddYears(Max(Solddate), -1), 'MM/DD/YYYY'))"}>} sales )

hope  your dimnsion should be :  Solddate

ger_alegria
Partner - Creator
Partner - Creator

You can do a master calendar from your sold date:

Load

      Year(Solddate) as Year,

      Month(Solddate) as Month,

      Day(Solddate) as Day,

      SoldDate,

      Sales

From....

After That, you can use an expresion like this:

Sum({<Year = {$(max(Year))}>}Sales)

-

Sum({<Year = {$(max(Year)-1)}>}Sales)

Anil_Babu_Samineni

So, Here what if you have forecast of data till November for 2017. In this case, If you select 2017 then what are expecting to see?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful