Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

multiply values from different sources

Hi guys,

I am recently blocked, my simply question is:

I have 2 Tables from 2 different sources:

Table1:

invoiceno,

ArtNo,

Amount,

Date

;

SQL * FROM X;

Table2:

invoiceno,

currency factor,

currency code,

date

;

SQL * FROM Y;

now I want to multiply like:

Load

if(currency code is not EUR, Amount*currency factor) as NewAmount

I want to show the values from Amount in a certain currency code: EUR

If the currency is not EUR, so the value should multiply it with the CFactor..

How can I solve this in Scripting ? or should I use it in the Straight

hope you can help me

Best regards

1 Solution

Accepted Solutions
PrashantSangle

Hi,

Use Left Join or Right Join or Join to join two tables

then use your expression in new table where you can call all the field from existing one i.e Resident table

Your script like

Table1:

invoiceno,

ArtNo,

Amount,

Date

;

SQL * FROM X;

//Table2:

left join

invoiceno,

currency factor,

currency code,

date

;

SQL * FROM Y;

final_table:

Load *

if(not wildmatch([currency code],'EUR'), Amount*currency factor) as NewAmount

Resident Table1;

Drop table Table1;

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

2 Replies
PrashantSangle

Hi,

Use Left Join or Right Join or Join to join two tables

then use your expression in new table where you can call all the field from existing one i.e Resident table

Your script like

Table1:

invoiceno,

ArtNo,

Amount,

Date

;

SQL * FROM X;

//Table2:

left join

invoiceno,

currency factor,

currency code,

date

;

SQL * FROM Y;

final_table:

Load *

if(not wildmatch([currency code],'EUR'), Amount*currency factor) as NewAmount

Resident Table1;

Drop table Table1;

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
sundarakumar
Specialist II
Specialist II

1.  if u want it to do in th eback end u will have to join the currency code to the accont table with a primary key and bring all details in a sigle table.

2.  If u want it to do it in front end keep them linked with a key and u can straight away do it in the front end.

Violume of data defines which way is better.

I would prefer option 1 since it will improve performance.

-Sundar