Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good day!
In load script i load table from excel:
Main:
LOAD
Id,
Year(Date)&num(Month(Date),'00') as YearMonth,
avg(Sum)
FROM
$(DataPath)Test.xlsx
(ooxml, embedded labels, table is Sheet1)
;
in result i get table:
Id | Date | Sum |
1 | 01.01.2015 | 4 |
1 | 02.01.2015 | 6 |
1 | 03.01.2015 | 4 |
1 | 04.01.2015 | 6 |
1 | 05.01.2015 | 37 |
1 | 06.01.2015 | 4 |
1 | 07.01.2015 | 2 |
1 | 08.01.2015 | 7 |
1 | 09.01.2015 | 4 |
1 | 01.02.2015 | 4 |
1 | 02.02.2015 | 6 |
1 | 03.02.2015 | 3 |
1 | 04.02.2015 | 6 |
1 | 05.02.2015 | 3 |
1 | 06.02.2015 | 1 |
1 | 07.02.2015 | 3 |
1 | 08.02.2015 | 5 |
1 | 09.02.2015 | 76 |
How i load script calculate average sum group by YearMonth?
My necessary result:
Id YearMonth Sum
1 201501 8.2
1 201502 11.8
Thanks.
no. not only 1.
There will be more values
=aggr(avg(sales),month)