Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a table with 2 columns: Id and Temp. In a 3rd column I need the average value of the column Temp for equal Id's. Attached you find the wished table.
How can I generate this 3rd column in the script after loading the first 2 columns?
Thanks!
Script solution.
tab1:
LOAD * INLINE [
Id, Temp
1, 5
1, 4
1, 3
2, 7
2, 7
2, 9
2, 9
3, 6
];
Left Join(tab1)
LOAD Id, Avg(Temp) As AvgTemp
Resident tab1
Group By Id;
Hi, you can try with:
Avg(TOTAL <Id> Temp)
If Ruben's post got you what you needed, we would appreciate it if you could return to the thread and close it out by using the Accept as Solution button on his post. This gives him credit for the help and lets other members know that worked.
The only other thing I have is the following Design Blog post that may be of some further help:
https://community.qlik.com/t5/Qlik-Design-Blog/Average-Which-average/ba-p/1466654
Regards,
Brett
Script solution.
tab1:
LOAD * INLINE [
Id, Temp
1, 5
1, 4
1, 3
2, 7
2, 7
2, 9
2, 9
3, 6
];
Left Join(tab1)
LOAD Id, Avg(Temp) As AvgTemp
Resident tab1
Group By Id;