Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

data aggregation while loading data

Hi,

I'd like to aggregate the data while loading it from the Source.

Let me give you an example.

This is my data. There are fields 'year' and 'month'. But actually I don't need split by month in my dashboard. So I'd like to aggregate the data by year and make the whole dataset smaller. Is it possible on the backfront in QlikView? !

 

BrandsYearMonthCost
Brand12013Jan10
Brand22013Feb15
Brand12013Mar20
Brand12013Apr30
Brand22013May10
Brand12014Jan5
Brand22014Feb15
Brand12014Mar20
Brand22014Apr30
Brand12014May10

Thank you in advance,

Larisa

1 Solution

Accepted Solutions
sunny_talwar

Is this what you are envisioning?

Capture.PNG

Script:

Table:

LOAD Brands,

     Year,

     Month,

     Cost

FROM

[https://community.qlik.com/thread/164550]

(html, codepage is 1252, embedded labels, table is @1);

Table1:

LOAD Brands,

  Year,

  Sum(Cost) as Cost

Resident Table

Group By Year, Brands;

DROP Table Table;

If yes then PFA..

Best,

Sunny

View solution in original post

4 Replies
sunny_talwar

Is this what you are envisioning?

Capture.PNG

Script:

Table:

LOAD Brands,

     Year,

     Month,

     Cost

FROM

[https://community.qlik.com/thread/164550]

(html, codepage is 1252, embedded labels, table is @1);

Table1:

LOAD Brands,

  Year,

  Sum(Cost) as Cost

Resident Table

Group By Year, Brands;

DROP Table Table;

If yes then PFA..

Best,

Sunny

awhitfield
Partner - Champion
Partner - Champion

Or just don't load the Month data.

Andy

Agis-Kalogiannis
Employee
Employee

The Group By clause is what you need to do something like this on the script.

If you need something similar on the front end, you'll have to use the aggr() function.

example:

aggr(sum(Cost), Year) or aggr(sum(Cost), Year, Brands) depending on what you want to show.

Agis

Anonymous
Not applicable
Author

Thanks everyone for your comments!