Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
kruel830
Contributor II
Contributor II

Splitting weekly values into working days

Hi,

I  have a problem as  in database weekly item consumption forecasts are always dated for mondays, but ERP distributes them evenly on working days. As ERP numbers are "correct" and Qlik shows it  "wrong", how it is possible to divide forecast as ERP does it?

For example 30.8.2021 forecast shows 10 units, what I want is 2 units for 30.8., 2 units for 31.8.,  2 units for 1.9., 2 units for 2.9. and 2 units for  3.9.. And so on.

Please help me to understand how this should be done in Qlik.

1 Solution

Accepted Solutions
JordyWegman
Partner - Master
Partner - Master

Hi,

You could try this:

// Load the forecast and get the daily average
Forecast:
Load
    Week,
    Forecast / 5 as DayAverage
From [YourSource] (qvd) ;

// Join all the working days from a calendar. This will expand the Forecast table.
Left Join ( Forecast )
Load
    Week,
    Date
From [YourSource] (qvd) 
Where NOT Match( Day( Date ) , 'Sat', 'Sun' ) 
;

Jordy

Climber

Work smarter, not harder

View solution in original post

2 Replies
JordyWegman
Partner - Master
Partner - Master

Hi,

You could try this:

// Load the forecast and get the daily average
Forecast:
Load
    Week,
    Forecast / 5 as DayAverage
From [YourSource] (qvd) ;

// Join all the working days from a calendar. This will expand the Forecast table.
Left Join ( Forecast )
Load
    Week,
    Date
From [YourSource] (qvd) 
Where NOT Match( Day( Date ) , 'Sat', 'Sun' ) 
;

Jordy

Climber

Work smarter, not harder
kruel830
Contributor II
Contributor II
Author

 Your solution gave the result I was expecting.  Thank you!