Qlik Community

Ask a Question

New to Qlik Sense

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

Announcements
March 11, 2PM EST: Do More with Qlik - Getting Started wtih Qlik Sense SaaS - Redux. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
fredrik_olsson
Contributor III
Contributor III

Left Join Resident load and combining fields from both tables

Hi,

I have to different tables I want to combine and when I left join InvoiceItems table I want to multiple InvoicePrice & InvoicePriceFactor if InvoicePriceFactor exists for that InvoiceID.

Any help is appreciated! 

 

InvoiceItems:

InvoiceIDInvoicePriceInvoiceCost
1001107
1002124
100343

 

InvoiceMapping

InvoiceIDInvoicePriceFactorInvoiceCostFactor
10010,71
10030,3

 

InvoiceItems:
LOAD
InvoiceID
InvoicePrice
InvoiceCost;

InvoiceMapping:
LOAD
InvoiceID,
InvoicePriceFactor,
InvoiceCostFactor;

LEFT JOIN (InvoiceItems)
LOAD IF (InvoicePriceFactor <> '', InvoicePriceFactor *InvoicePrice) as InvoicePrice RESIDENT InvoiceMarginMapping;
DROP TABLE InvoiceMapping;

 

 

1 Solution

Accepted Solutions
wbmuller
Partner
Partner

Hi there

try this:

InvoiceItems_Temp:
LOAD
InvoiceID,
InvoicePrice,
InvoiceCost
From (Your Data Source);

LEFT JOIN (InvoiceItems_Temp)
LOAD
InvoiceID,
InvoicePriceFactor,
InvoiceCostFactor;
From (Your Data Source);

InvoiceItems:
LOAD
InvoiceID,
InvoicePriceFactor * InvoicePrice as InvoicePrice,
InvoiceCost,
InvoicePriceFactor,
InvoiceCostFactor
Resident InvoiceItems_Temp;

DROP TABLE InvoiceItems_Temp;

View solution in original post

1 Reply
wbmuller
Partner
Partner

Hi there

try this:

InvoiceItems_Temp:
LOAD
InvoiceID,
InvoicePrice,
InvoiceCost
From (Your Data Source);

LEFT JOIN (InvoiceItems_Temp)
LOAD
InvoiceID,
InvoicePriceFactor,
InvoiceCostFactor;
From (Your Data Source);

InvoiceItems:
LOAD
InvoiceID,
InvoicePriceFactor * InvoicePrice as InvoicePrice,
InvoiceCost,
InvoicePriceFactor,
InvoiceCostFactor
Resident InvoiceItems_Temp;

DROP TABLE InvoiceItems_Temp;

View solution in original post