Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
madnanansari
Creator
Creator

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?

19 Replies
madnanansari
Creator
Creator
Author

pls. find attach the data files (QVD) for the sample data as well.

shraddha_g
Partner - Master III
Partner - Master III

PFA..

Worked with LastYTDflag.

madnanansari
Creator
Creator
Author

I need Sales for Last Year Same day that is 01-Dec-2016 is thursday, so I need sales on thursday last december which is 03-Dec-2015.

The below is the formula;

Sum(

{<

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

>}

Sales

)

but as explained its not working. I dont need last year same date sales.

shraddha_g
Partner - Master III
Partner - Master III

Calculate WeekDay , Week , Year in master calendar by using

weekday(Date) as WeekDay,

week(Date) as Week,

Year(Date) as Year

expression as

sum( { < WeekDay = {"$(= weekday( max(Date)))"} , Week = {"$(=week(max(Date)))"}, Year = {"$(=year(Max(Date))-1)"} > } Sales )

madnanansari
Creator
Creator
Author

I dont need last year same date sales but if this is also working then my job is over.

Select Nov-2016 and see whether the results are appearing?

shraddha_g
Partner - Master III
Partner - Master III

sum( { < WeekDay = {"$(= weekday( max(Date)))"} , Week = {"$(=week(max(Date)))"}, Year = {"$(=year(Max(Date))-1)"} > } Sales )

this expression will consider weekday as Mon,Tue, etc to compare with last year

madnanansari
Creator
Creator
Author

Formula seems to be correct but its not working. U have the test application; can u try on that?

shraddha_g
Partner - Master III
Partner - Master III

can you send the one you tried with this expression?

madnanansari
Creator
Creator
Author

its the same i uploaded here before

madnanansari
Creator
Creator
Author

pls. find attached the app i tried with,