Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Calculated Field from 2 Tables

hi

I have 2 tables :

Tbl1:

productID

Price

tbl2:

QTY

ProductID

I need to make field as Price*QTY= TOTAL SALES

i make other table as :

load price

from Tbl1;

join

load  QTY from Tbl2;

but is make many tables and cant make new field.......

how to join is ???

1 Solution

Accepted Solutions

Re: Calculated Field from 2 Tables

May be try with the mapping load:

MappingTable:

Mapping

LOAD ProductID,

          QTY

FROM...

Tbl1:

LOAD ProductID,

          Price,

          Price * ApplyMap('MappingTable', ProductID) as [Total Sales]

FROM ....

5 Replies

Re: Calculated Field from 2 Tables

May be try with the mapping load:

MappingTable:

Mapping

LOAD ProductID,

          QTY

FROM...

Tbl1:

LOAD ProductID,

          Price,

          Price * ApplyMap('MappingTable', ProductID) as [Total Sales]

FROM ....

Not applicable

Re: Calculated Field from 2 Tables

How many mapping tables I can create ?

oknotsen
Honored Contributor III

Re: Calculated Field from 2 Tables

In theory unlimited.

So if you want to create 8000 mapping tables: Have fun.

May you live in interesting times!
Not applicable

Re: Calculated Field from 2 Tables

But

mapping table include only 2 columns

if i work with 10 Tables.....for any new field i need made new mapping table............

oknotsen
Honored Contributor III

Re: Calculated Field from 2 Tables

You need all those fields in calculations?

If not, use JOIN the tables instead.

May you live in interesting times!
Community Browser