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

compare current date with previous year date

hello everyone

i have date column names as date in the format of yyyy-mm-dd

and it consist of date ranging from 2017-01-01 till today that is 2019-10-09

now i want to compare sum(sales) of today with last year

for ex:-

date          |    sales| lastyear|        sales

2019-10-09| 500$ |2018-10-09| 800$ 

please help 

also i dont want to use calendar script as it is complicated

i want to keep it simple like set analysis.

1 Solution

Accepted Solutions
riishabhz
Creator
Creator
Author

i have solved it by creating 4 variables like:

currentyearstart=2019-01-01

currentyearend=2019-12-31

previousyearstart=2018-01-01

previousyearend=2018-12-31

and attached calendar to it

View solution in original post

5 Replies
StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

try to use Addyears(Today(),-1) in set analysis

riishabhz
Creator
Creator
Author

hello sir

now date is showing of previous year but how to get sales data in it?

my column for sales data is sales

StarinieriG
Partner - Specialist
Partner - Specialist

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

riishabhz
Creator
Creator
Author

sir its showing same sales data as of today.

 

riishabhz
Creator
Creator
Author

i have solved it by creating 4 variables like:

currentyearstart=2019-01-01

currentyearend=2019-12-31

previousyearstart=2018-01-01

previousyearend=2018-12-31

and attached calendar to it