Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Scripting question / Adding two columns

Hello everyone,

I am facing a (i'm sure it is) really easy problem...

I have two tables, let's say :

TableA :

LOAD

dim1,

dim2,

dim3,

metricA

FROM a.qvd (qvd);

TableB :

LOAD

dim1,

dim2,

metricB

FROM b.qvd (qvd);

In the end, i'd like to have a Table C with the following columns :

dim1,

dim2,

dim3,

metricA + metricB

Thanks a lot for your help.

Damien

Labels (1)
1 Reply
swuehl
Champion III
Champion III

If I understood correctly, you should be able to join the two tables and then do a rangesum of fields metricA and metricB, maybe like this (untested):

TableA :

LOAD

dim1,

dim2,

dim3,

metricA

FROM a.qvd (qvd);

left join (TableA) LOAD

dim1,

dim2,

metricB

FROM b.qvd (qvd);

Result:

LOAD *, rangesum(metricA,metricB) as SumOfMetrics resident TableA;

drop table TableA,

//drop fields metricA,metricB; //drop if needed