Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I want to convert all values from a table by currency. So , I have two tables like this:
CustomerID | Currency | Sales |
---|---|---|
1 | RON | 100 |
1 | EUR | 200 |
1 | USD | 150 |
Currency | Variation(RON) |
---|---|
RON | 1 |
EUR | 4.4610 |
USD | 3.9492 |
I want to have a 4th column in the first table named EQRON in wich I want to calculate all values to RON.
Example : For the row where we have EUR : the value for EQRON should be : 200 * 4.4610.
Can you please help me?
Thanks.
Hi Razvan,
You can try this
Table1:
LOAD * INLINE [
CustomerID, Currency, Sales
1, RON, 100
1, EUR, 200
1, USD, 150
];
Left Join (Table1)
LOAD * INLINE [
Currency, Variation(RON)
RON, 1
EUR, 4.4610
USD, 3.9492
];
Table:
LOAD
CustomerID,
Currency,
Sales,
(Sales*[Variation(RON)]) as EQRON
Resident Table1;
DROP Table Table1;
Hi Razvan,
you can try to use a variable in this case,
check this : Creating and understanding variables in QlikView - YouTube
i hope that helps
beck
Hi,
you can those calculations on the load script:
like
tab:
load * inline
[
customer, currency, sales, eqron
1, RON, 200, 200*4.4610
];
or
tab:
Load *;
SQL SELECT customer, currency, sales, if(currency='RON', sales*4.4610
FROM your_table;
or
if you want to use your two tables just make a letf join between them.
HTH
André Gomes
Hi Razvan,
Is this are you looking for?
Hi Razvan,
You can try this
Table1:
LOAD * INLINE [
CustomerID, Currency, Sales
1, RON, 100
1, EUR, 200
1, USD, 150
];
Left Join (Table1)
LOAD * INLINE [
Currency, Variation(RON)
RON, 1
EUR, 4.4610
USD, 3.9492
];
Table:
LOAD
CustomerID,
Currency,
Sales,
(Sales*[Variation(RON)]) as EQRON
Resident Table1;
DROP Table Table1;
Hy , I haven`t tried yet the suggestions. I will come back with a response as soon as possible
Thank you.
Hy Saikat Ghosh.
That is what i was looking for.
Thank you.
If your question is now answered, please flag the Correct Answer (via the big "Correct Answer" button near every post) and Helpful Answers (found under the Actions menu under every post).
If not, please make clear what part of this topic you still need help with .