Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Comparison between two dates in qlik sense

Hi,

I want to compare sum of my revenue this year and last year for eg if my current date is 2017-08-02(YYYY-MM-DD) format i want to compare this to 2016-08-02 in my chart . what would be the set analysis expression used in this ?

4 Replies
consultant_bi
Creator
Creator

hello,

the set analysis formula i tried is

sum({$<[OrderDate.autoCalendar.Date]={">=11/05/2010<=11/04/2012"}>}Sales)

it's gonna give you  the sum of each year 2016 and 2017 on this period specified


but mention that my field [OrderDate.autoCalendar.Date] have the format  DD/MM/YYYY

Sans titre2.png

Sans titre.png

Ricardo_Gerhard
Employee
Employee

Dear Nupur,

Like this? set analysis today()

Ricardo Gerhard
OEM Solution Architect
LATAM
OmarBenSalem

It would be sthing like this:

sum({<Date={"$(=max(Date))"}>}YourMeasure)

sum({<Date=,YearField=,MonthField=, Date={"$(=addYears(max(Date),-1)"}>}YourMeasure)

zebhashmi
Specialist
Specialist

sum({<Datefield = {">=today()-365<=today()}>}revenue)

sum({<Datefield = {">=today()-730<=today()-365}>}revenue)