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

Demand per Month

Hello,

I have a delivery positions table with "material id", "order date" and "order quantity". In another table there is also the "materialgroup id" for each material, I want to calculate the avg demand for each month and for each material group.

Example:

material idorder dateorder quanity
0011.1.2019100
0015.1.201930
0011.2.201950
0021.1.201920
00210.1.2019

100

 

material idmaterial group
001A
002B

 

So in this example i should get:

Group A: 
130 for January
50 for February

 

Group B:
120 in January

 

Thanks for your help!

11 Replies
sunny_talwar

@Oliver1 are you saying that you don't have a Month or MonthYear field in the script and you don't want to create one? Is there a reason you don't want to create this field?

Oliver1
Contributor III
Contributor III
Author

Sorry for the delayed response @sunny_talwar !

One Problem is, that the material_group_id is in an extra table.

I have the following tables:

delivery positions:

material idorder dateorder quanity
0011.1.2019100
0015.1.201930
0011.2.201950
0021.1.201920
00210.1.2019

100

 

material master data

material idmaterial group
001A
002B

 

forecast

material group idforecast date (MM.YYYY)forecast quantity
A1.2019150
A2.201950
B1.2019130

 

Now I want to compare the forecast quantity with the order quantity and calculate the forecast accuracy like that for each material group  and for each month:

FCA (%) = (1-ABS(order quantity - forecast quantity)/order quantity)*100

 

So I have the FCA for each material group and for each month and then I want to get the average value.

So in the end there should be an average FCA calculated in a chart function, if it is not necessary i do not want to calculate something in de load editor.

I hope now you can understand my problem and thank you for helping me!

 

Best regards,

Oliver