Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Unifying tables

Hey, everyone!

I have an Issue:

I've 2 tables, like those:

  

Table A
ContinentValue
Europe100
South America150
North America92

  

Table B
ContinentValue
Europe200
South America123
Central America200
Oceania105

I want to unify those tables, but, keeping the values from Table A and bring from Table B, only the continents which doesn't exists in Table A.

Sincerely, Luiz Bisco

1 Solution

Accepted Solutions
sunny_talwar

May be using Where not Exist()

Table:

LOAD * INLINE [

    Continent, Value

    Europe, 100

    South America, 150

    North America, 92

];

Concatenate(Table)

LOAD * INLINE [

    Continent, Value

    Europe, 200

    South America, 123

    Central America, 200

    Oceania, 105

]

Where not Exists(Continent);

Capture.PNG

View solution in original post

2 Replies
oknotsen
Master III
Master III

Load both (naming the table TableA); they will auto concatenate since the fields have the same name.

Next, do this script:

TableEndresult:

noconcatenate

Load Continent,

sum(Value) as Value

resident TableA

group by Continent

;

drop table TableA;

May you live in interesting times!
sunny_talwar

May be using Where not Exist()

Table:

LOAD * INLINE [

    Continent, Value

    Europe, 100

    South America, 150

    North America, 92

];

Concatenate(Table)

LOAD * INLINE [

    Continent, Value

    Europe, 200

    South America, 123

    Central America, 200

    Oceania, 105

]

Where not Exists(Continent);

Capture.PNG