Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
i_villafranca
Contributor
Contributor

Set analysis comparison date - 365

Dear community,

I am trying to compare the data from this year vs LY. I know it seems pretty simple, but I can´t get it...

My final graph should look like this:

  

DayThis YearLast Year
01/01/201810090
02/01/2018139175
03/01/2018147200
04/01/2018140

160

I am trying with the following expression, but I don´t get any result:

Sum( {$< Day ={$(=Date(Only(Day)-365,'DD/MM/YYYY'))}>} Revenue)


Thanks for the help!

3 Replies
marcus_sommer

Try something like this: sum({< Revenue = {"=Day=date(Day-365, 'DD/MM/YYYY)"}>} Revenue)

- Marcus

Anil_Babu_Samineni

Perhaps this?

Create Field in script like

Year(Day) as Year

And then use this

CY - Sum({<Year = {$(=Year(Today()))}>} Revenue)

LY - Sum({<Year = {$(=Max(Year))>} Revenue)

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
antoniotiman
Master III
Master III

Perhaps You need AsOfTable technique, like this

Table:
LOAD * Inline [
Day,Revenue
01/01/2018,10
02/02/2018,20
03/03/2018,30
04/04/2018,40
01/01/2017,11
02/02/2017,21
03/03/2017,31
04/04/2017,41
]
;
Temp:
LOAD DISTINCT Day Resident Table;
Join (Temp) LOAD Day as AsOfDay Resident Temp;

LOAD Day,AsOfDay,AsOfDay-Day as DayDiff
Resident Temp
Where AsOfDay >= Day;
Drop Table Temp;

Regards,

Antonio