Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

adding same dimension to fact table

Hi,

How do I load the tables below to my data model without creating a circular reference?

Ideally I don't want to have two sets of variables for each currency field since there are many fields in this model anyway.

FXRateCurrency
FXIDCurrencyID
CurrencyFromIDCurrency Name
CurrencyToIDCurrency Code
Rate
Date
Tags (1)
1 Solution

Accepted Solutions
migueldelval
Valued Contributor

Re: adding same dimension to fact table

Hi Shauncass,

Try this example please and tell me.

Regards

Miguel del Valle

8 Replies
migueldelval
Valued Contributor

Re: adding same dimension to fact table

Hi Shaun,

FXRATE:

Load

FXID,

CurrencyFromID,

CurrencyToID,

Rate,

Date;

From SQL [...];

left join

CURRENCY:

Load

CurrencyID,

CurrencyName,

CurrencyCode;

From SQL [...];


Try it, but it´s better to attach all your data model to see it.


Regards


Miguel del Valle

Not applicable

Re: adding same dimension to fact table

Sorry Miguel. I wasn't clear.
I need the CURRENCY.CurrencyID to join on FXRATE.CurrencyFromID
I also need the CURRENCY.CurrencyID to join on FXRATE.CurrencyToID

migueldelval
Valued Contributor

Re: adding same dimension to fact table

Sorry Shauncass, but I can´t understan you.

If you want to join tables you need same field equal in both tables to make a relationship.

Attach an example of data, please.

Regards

Miguel del Valle

Not applicable

Re: adding same dimension to fact table

My data looks as follows;

CURRENCY

CurrencyID     CurrencyName     CurrencyCode

1                    US Dollar             USD

2                    Euro                     EUR

3                    British Pound        GBP

FXRATE

FXID              CurrencyFromID     CurrencyToID     Rate

1                    1                           2                        0.90

2                    1                           3                        0.74

3                    2                           3                        0.83

In my dashboard I want to represent something similar to the following;

FXID              CurrencyFrom     CurrencyTo     Rate

1                    USD                   EUR               0.90

2                    USD                   GBP               0.74

3                    EUR                   GBP               0.83

migueldelval
Valued Contributor

Re: adding same dimension to fact table

Hi Shauncass,

Try this example please and tell me.

Regards

Miguel del Valle

Not applicable

Re: adding same dimension to fact table

Miguel,


This looks perfect, how did you go about achieving it? What is in your load script?

migueldelval
Valued Contributor

Re: adding same dimension to fact table

Hi shauncass,

I made a fact table with the equivalent values.

Regards

Miguel del Valle

Not applicable

Re: adding same dimension to fact table

Thank you