Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Matching forecast with sales

I need some help with figuring out how to display a forecast with older sales. I have future forecasts that I want to display next to sales from the previous year. I have some small files attached. If anyone could help with this, I would appreciate it

WeekProductForecast
201431A150,000
201430B300,000

WeekProductSales
201331A142,200
201330B535,000
201231A112,200
201230B300,000

I want it to display like this:

WeekProductForecastSales in 2013Sales in 2012
201431A150,000142,200112,200
201430B300,000535,000300,000
13 Replies
maxgro
MVP
MVP

see attachment

Gysbert_Wassenaar

See attached example


talk is cheap, supply exceeds demand
Not applicable
Author

This is almost perfect!!! I do have one issue though.. all my sales are coming in as the monday dates... so instead of 2014/32 .. it shows up as 8/4/2014..

What is a way to go about this?

maxgro
MVP
MVP

to change a date in   year/week

=Year(yourdatefield) & '/' & num(Week(yourdatefield), '00')

Not applicable
Author

I'm having trouble changing the dates and then making it work. Can you make an example using the new sample sales file?

Also - since the dates for this year and last year won't match up... what can we do about it? is there any way we can add 1+ day ? (i.e 8/4/2014 is a Monday but 8/4/2013 is a Sunday...)

MarcoWedel

Hi,

one more possible solution:

QlikCommunity_Thread_129627_Pic1.JPG.jpg

QlikCommunity_Thread_129627_Pic3.JPG.jpg

QlikCommunity_Thread_129627_Pic4.JPG.jpg

QlikCommunity_Thread_129627_Pic2.JPG.jpg

tabForecastSales:

LOAD WeekName(MakeWeekDate(Left(@1,4), Right(@1, Len(@1)-4))) as Week,

    Right(@1, Len(@1)-4) as WeekNum,

    Left(@1, 4) as Year,

    @2 as Product,

    Money(@3,'#,##0 €;-#,##0 €') as Amount,

    'Forecast' as Type

FROM [http://community.qlik.com/servlet/JiveServlet/download/589519-120409/forecast%20sample.xls]

(biff, no labels, table is Sheet1$);

LOAD WeekName(Week) as Week,

    Week(Week) as WeekNum,

    Year(Week) as Year,

    Product,

    Money(Sales,'#,##0 €;-#,##0 €') as Amount,

    'Sales' as Type

//FROM [http://community.qlik.com/servlet/JiveServlet/download/589519-120408/sales%20sample.xls]

//(biff, embedded labels, table is Sheet1$);

//

//Inline Load due to wrong years in sample data

INLINE [

    Week, Product, Sales

    08/04/2013, A, 142200

    07/28/2013, B, 535000

    08/04/2012, A, 112200

    07/28/2012, B, 300000

];

hope this helps

regards

Marco

Not applicable
Author

Does this address the date issue?

This year and last year won't match up... what can we do about it? Is there any way we can add 1+ day ?

(i.e Week 32 - 8/4/2014 is a Monday but 8/4/2013 is a Sunday...so I would need 8/5 for year 2013 and 8/6 for 2012 in order for the weeks to match up, that is be Week 32.


Does this make sense?


MarcoWedel

I understood, that you compare equal week numbers across multiple years while getting your sales data per date (mondays) not per week.

It's due to your sample data, that 8/4/14, 8/5/13 and 8/6/12 are not in the same week number und thus can't be compared.

Maybe you can extend your sample data to clarifiy?

regards

Marco

Not applicable
Author

Data set is now fixed to help with this particular problem. Thank you, your help is appreciated

Note: Forecast is by week numbers and Sales is by Monday dates.