Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

guptanupur
New Contributor II

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
Contributor

Re: Comparison between two dates in qlik sense

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

Employee
Employee

Re: Comparison between two dates in qlik sense

Dear Nupur,

Like this? set analysis today()

OmarBenSalem
Esteemed Contributor

Re: Comparison between two dates in qlik sense

It would be sthing like this:

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

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

zebhashmi
Valued Contributor

Re: Comparison between two dates in qlik sense

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

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

Community Browser