Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi to everyone,
I need help with the following problem.
I have loaded a table by script
TABLE1
NAME | SUB_NAME | VALUE1 | VALUE2 |
---|---|---|---|
A | A1 | 1 | 0 |
A | A1 | 0 | 1 |
A | A2 | 2 | 0 |
A | A3 | 1 | 0 |
A | A4 | 1 | 0 |
A | A5 | 1 | 0 |
I would like to have another table like this.
TABLE2
NAME | SUB_NAME | VALUE1 | VALUE2 |
---|---|---|---|
A | A1 | 1 | 1 |
A | A2 | 2 | 0 |
A | A3 | 1 | 0 |
A | A4 | 1 | 0 |
A | A5 | 1 | 0 |
If anyone could help me I'll be grateful.
Thanks
Hi,
Do the following:
Load
NAME,
SUB_NAME,
sum(VALUE1) as VALUE1
sum(VALUE2) as VALUE2
From [Whatever]
group by NAME,SUB_NAME;
Hi,
Do the following:
Load
NAME,
SUB_NAME,
sum(VALUE1) as VALUE1
sum(VALUE2) as VALUE2
From [Whatever]
group by NAME,SUB_NAME;
Hi Felip,
thank you for the help. I've already tried this solution but it doesn't work. Probably I'm missing something.
Here is my situation
TABLE1:
Load
NAME,
SUB_NAME,
VALUE1,
VALUE2,
From [....]
TABLE2:
Load *,
Sum (VALUE1) as VALUE1,
Sum (VALUE1) as VALUE2
Resident TABLE1
Group By NAME, SUBNAME;
Drop Table TABLE1;
Hi,
Table1:
Load * inline [
NAME, SUB_NAME, VALUE1, VALUE2
A, A1, 1, 0
A, A1, 0, 1
A, A2, 2, 0
A, A3, 1, 0
A, A4, 1, 0
A, A5, 1, 0
];
NoConcatenate Table2:
Load NAME
,SUB_NAME
,sum(VALUE1) as VALUE1
,sum(VALUE2) as VALUE2
Resident Table1
group by NAME
,SUB_NAME
;
Drop Table Table1;