Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
SeanJohnson22
Contributor
Contributor

Average cost of metal waste and plastic waste based on the number of panels built

Hello,

I am new to the community and I am looking for some assistance with a problem. I am attempting to create a bar chart with two measures that displays the average cost of METAL WASTE and PLASTIC WASTE based on the number of panels built by a supplier per month (SUM OF WASTE COST PER MONTH/ SUM OF SUPPLIER PANELS BUILT PER MONTH )* 100'

 

My original code provided me the average metal/plastic waste cost based on the total sum of SUPPLIER PANELS BUILT FOR ALL MONTHS available (Not perfect, but it worked).

 

FABS(sum({<WASTE TYPE= {'METAL WASTE'}>}Num#([SI65C.EXTENDED_COST], '0;0-')))

/

rangesum(sum(SUPPLIER1_PANELS_BUILT) + sum(SUPPLIER2_PANELS_BUILT)) * 100

 

 

FABS(sum({<WASTE TYPE= {'PLASTIC WASTE'}>}Num#([SI65C.EXTENDED_COST], '0;0-')))

/

rangesum(sum(SUPPLIER1_PANELS_BUILT) + sum(SUPPLIER2_PANELS_BUILT)) * 100

 

 

how could I restructure the code to provide the calculation below??

'SUM OF METAL COST PER MONTH/  TOTAL SUM OF SUPPLIER PANELS PER MONTH * 100' & 

'SUM OF PLASTIC COST PER MONTH/  TOTAL SUM OF SUPPLIER PANELS PER MONTH * 100'

 

The below chart is calculated as SUM OF METAL COST PER MONTH/ TOTAL SUM OF SUPPLIER PANELS BUILT YTD * 100 and the plastic waste is calculated the same way 

SeanJohnson22_2-1633391052023.png

 

 

Table view of panels built by both suppliers. need to calculate the total panels built for each month and use it to find the average cost of  metal waste/plastic waste.

SeanJohnson22_2-1633389626276.png

 

Table view of Material Waste and Extended cost(QTY*COST). Need to sum all METAL WASTE for each month and another measure to sum PLASTIC WASTE for each month and divide by total panels built by both suppliers for each month.

SeanJohnson22_1-1633390869513.png

 

 

 

 

 

 

0 Replies