Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to calculate field in script after joining two tables

Can someone explain to me how to calculate a field in the script from two fields in a table that is the result of left-joining to load statements?

Here is the simplified script

Tab1:

Load

     CustomerName,

     InvoiceDate,

     InvoiceValueEuro

From file1

Left Join Load

     InvoiceDate,

     ExchangeRate

From file2

What is the next step to add to this table the field InvoiceValueUSD=InvoiceValueEuro*ExchangeRate  ??

4 Replies
MVP
MVP

A simple approach would be a resident load (or store to and load from a qvd) with adding the new field:

Result:

LOAD *, InvoiceValueEuro*ExchangeRate as InvoiceValueUSD

Resident Tab1;

drop table Tab1;

MVP
MVP

Or you could do a Mapping Load of your Exchangerate table first,

then use applymap function in creation of your new field while loading your value table.

Not applicable

Thanks a lot for both answers. I have tried both solutions, and each works fine.

Contributor
Contributor

Hi I have a similar query .i need to create a new table and the majority of the fields in this table are derived from a calculation based on couple of other resident table fields . how should i mention it in the script .please help