Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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

1 Reply
MVP
MVP

Scripting question / Adding two columns

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

Community Browser