Discussion Board for collaboration on QlikView Scripting.
In load script i load table from excel:
Year(Date)&num(Month(Date),'00') as YearMonth,
(ooxml, embedded labels, table is Sheet1)
in result i get table:
How i load script calculate average sum group by YearMonth?
My necessary result:
Id YearMonth Sum
1 201501 8.2
1 201502 11.8
Go to Solution.
Avg(Sum) as AvgSum,
(ooxml, embedded labels, table is Sheet1);
avg(Sum) as AvgSum
group by Id,YearMonth;
drop table Data;
How i can add filed id Id to result table?
Just set the Dimension to YearMonth and the expression to Avg(Sum) and format the number as Integer 1dp
And you'll get:
Just add ID as another dim if required.
Thanks for advice.
But i need to do it in script level.
if you have multiple ids per year-month (and I guess you do) then you can't
How do you want it to look?
is id always 1?
if yes, just add min(id) as id in the first load
min(Id) as Id,