Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello qlikers 🙂 ,
I think a picture says more than words:
I have three coloums. I want to create the AVG of the number, but dependent on plant and the date, date is MM/YYYY. I want to do this in the load script. How can I generate the AVG of the number ? Later I want to build a line chart with the AVG and the date. For example red = Apr18 / AVG 6.
I hope someone could help me. Looking forward to your answer! Thank you in advance! 🙂
Cool, Try this
Table:
Load Plant, Date, Number From Table;
Left Join (Table)
Load Date, Avg(Number) as AVG Resident Table Group By Date;
Try to explain one part like Yellow color how the 2.6 is the expected?
Yellow =
Plant 1 | Jan 18 | 1 +
Plant 2 | Jan 18 | 2 +
Plant 3 | Jan 18 | 4 =
7 / 3 = 2,3333 (sorry, 2,666667 is wrong, yellow avg should be 2,3333)
Did it help?
Cool, Try this
Table:
Load Plant, Date, Number From Table;
Left Join (Table)
Load Date, Avg(Number) as AVG Resident Table Group By Date;
Thank you very much for this quick answer! But unfortunately the plant is not included.
Should I included the plant in the group by?
Table: Load Plant,
Date, Number
From Table;
Left Join (Table)
Load
Date,
Avg(Number) as AVG
Resident Table
Group By Date
And Plant;
Thank you in advance! 🙂
FYI: Group By works on row based hence as per output needed the solution will work. If you simply copy paste? Is that something not working?
I'm sorry. Thank you very much. That worked! 🙂