Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
Highlighted
madnanansari
Contributor

Last Year Same Day Sales

I am trying to create a table with the below information:

Date, Sales, Sales (Last Year Same Day)

01/12/2016, 50, 21

02/12/2016, 23, 21

..

..

for Sales (Last Year Same Day) I am trying the below formula:

Sum(

{<

[Date]={$=(Max([Date])-364)}

>}

Sales

)

This is just bringing '0'. I tried lot of options but it don't work at all.

Any help?

Tags (1)
19 Replies
Partner
Partner

Re: Last Year Same Day Sales

Try

Sum(

{<

[Date]={"$(=date(addyears(Max([Date]),-1)))" }

>}

Sales

)

MVP
MVP

Re: Last Year Same Day Sales

SUM({<YourDateField = {'$(=Date(AddYears(Max(YourDateField),-1))'}>}Sales)

madnanansari
Contributor

Re: Last Year Same Day Sales

this works fine when there is no master calendar. Once I use one; it shows zero values then.

Master calendar has other columns as well like Quarter, Year, Month etc along with Date.

kalyanivintha1
Contributor II

Re: Last Year Same Day Sales

Hello Mohammad,

you don't want to use.. -364 like this...

we have a...calendar functions like...addyears and addmonths to play on date fields.

Try your expression like this...

sum({<Your Date filed={$(=AddYears(Today(),-1))}>}[Final Price])

or

sum({<Your Date Field={$(=AddYears(Max(YourDateField),-1))}>}[Final Price])

madnanansari
Contributor

Re: Last Year Same Day Sales

I tried as you suggested and it shows zero.

Partner
Partner

Re: Last Year Same Day Sales

If possible share sample app

madnanansari
Contributor

Re: Last Year Same Day Sales

I have designed a sample App. How to share it here?

Partner
Partner

Re: Last Year Same Day Sales

click on Reply - > Use Advanced Editor on top right corner  - > attach at bottom right corner

madnanansari
Contributor

Re: Last Year Same Day Sales

Pls. find the sample app. The only sheet shows a filter of Month and the table shows day wise sales for each day of the month.