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: 
Not applicable

Aggregation while loading table

I have a script like this:

LOAD SHOPID,

  KostenartID,

  Date,

  Key,

  ValueIst,

  ValueForecast,

  ValuePlan2015

FROM Table1;

And the result will be a table with too many rows, because the values (last 3 columns) are located in different rows.

table.jpg

The first 4 colums have the same keys. Now I do not want to load 3 rows but 1 row, because the keys are the same.

How can I change the scriot to get a table like this

table2.jpg

Thanks in advance

BR

Thomas

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Assuming that the 'other' row's values are always 0 or null, then you could do this:

LOAD SHOPID,

  KostenartID,

  Date,

  Key,

  Sum(ValueIst) As ValueIst,

  Sum(ValueForecast) As ValueForecast,

  Sum(ValuePlan2015) As ValuePlan2015

FROM Table1

Group By

SHOPID,

  KostenartID,

  Date,

  Key;

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

4 Replies
Not applicable
Author

Hi Thomas

use them in expression not in dimension.

and use the avg or sum formula, as it suits you

Regards

harshita Gaur

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Assuming that the 'other' row's values are always 0 or null, then you could do this:

LOAD SHOPID,

  KostenartID,

  Date,

  Key,

  Sum(ValueIst) As ValueIst,

  Sum(ValueForecast) As ValueForecast,

  Sum(ValuePlan2015) As ValuePlan2015

FROM Table1

Group By

SHOPID,

  KostenartID,

  Date,

  Key;

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Try this;

LOAD SHOPID,

  KostenartID,

  Date,

  Key,

  sum(ValueIst) as ValueIst,

sum( ValueForecast) as ValueForecast,

maxstring( ValuePlan2015) as ValuePlan2015

FROM Table1

group by

SHOPID,

  KostenartID,

  Date,

  Key

;

Good Luck

Not applicable
Author

Hi,


Use sum(valueforecast) and other 2 in expression. But suppressing at script level is best.

Regards,

Navdeep