Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Converting to a Base Currency from separate tables

Hi Qlik Community,

Hope you can help, I am stumped with this one

I have three tables, two are from a SQL database and one is from a Excel Spreadsheet.

The two SQL tables have a relationship, No. but the Excel Spreadsheet does not as it is monthly exchange rates

SQL table 1 is called Orders with No., Date, Currency and Product

No.DateCurrencyProduct
847548119/11/14GBP1
847548221/11/14EUR1
847548305/12/14USD3
847548408/12/14GBP6

SQL table 2 is called Prices with No., and Price (each order may have multiple items)

NoPrice
84754811000
84754812000
84754821500
84754831600
84754841700
84754841300
84754841600

Excel table is called ExchangeRates with Month, Year, Currency, Exchange rate

MonthYearCurrencyExchange Rate
Nov2014GBP1
Nov2014EUR1.266
Nov2014USD

1.684

Nov2014GBP1
Dec2014EUR1.288
Dec2014USD1.680

I made a key by concatenating fields in Orders

[Currency]&Month("Date")&Year("Date")& AS [ExchangeID]

I did the same with ExchangeRates

[Currency]&[Month]&[Year] AS [ExchangeID]

This will give me a link between Orders and ExchangeRates (There is one 1 rate per currency per month).

Now I can create a straight table with the No. Dimension with the following Expression

SUM([Price]) / [Exchange Rate]

This will give me a list of Orders all in the same currency

I tried this as a chart to give me a totals per month (in the default currency) as the dimension but it says 'No Data to display'

My aim is to create a chart that would show the base currency no matter what dimension is selected, and I am not sure how to achieve this.

Please can you help me.

Thank you in advance

Mark

2 Replies
Anonymous
Not applicable
Author

is DD/MM/YY your default date format?

if not you need to format in Orders month and year like this:

 

[currency]%month(date#('19/11'14','DD/MM/YY')&year(date#('19/11/14','DD/MM/YY'))

Not applicable
Author

Hello Rudolf,

Thank you for your swift reply.

The Date format in the order table is DD/MM/YYYY (not shown in the Orders table, that was my mistake)