Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Getting rid of loop

Hi,

I have the following attached tables in my data model. How can I avoid creating loop?

Thanks,

1 Solution

Accepted Solutions
eduardo_sommer
Partner - Specialist
Partner - Specialist

Hi,

One possible solution is to rename the Company Region in the Tax Rates table to Tax Region AND bringing the Company Region from the COMPANY table to the FACT table (via a join or applymap) giving it also the name Tax Region. This will produce a synthetic key between The Tax Rates and the FACT Table, which can be resolved using a concatenated or autonumber field for the Year and Tax Region fields, maintaining both fields in the more granular side.

Something like:

COMPANY:

Load [Company Name],

        [Company Region],

        [Region Group],

        [Company Division],

        [Company Location]

From ...;

MapCompanyRegion:

Mapping

Load [Company Name],

        [Company Region]

Resident COMPANY;

FACT:

Load Year & '|' [Company Region] as YearRegion,

        [Company Name],

       KEY,

       [Reporting Currency],

       Month,

       Amount;

Load Year,

        [Company Name],

        ApplyMap('MapCompanyRegion', [Comapny Name]) as [Company Region],

        KEY,

        [Reporting Currency],

        Month,

        Amount

From ...;

TaxRates:

Load Year& '|' & [Company Region]  as YearRegion,

        Year,

        [Company Region] as [Tax Region],

        [Tax Rate]

From ...;

I hope this will help you

Regards

Eduardo

View solution in original post

2 Replies
eduardo_sommer
Partner - Specialist
Partner - Specialist

Hi,

One possible solution is to rename the Company Region in the Tax Rates table to Tax Region AND bringing the Company Region from the COMPANY table to the FACT table (via a join or applymap) giving it also the name Tax Region. This will produce a synthetic key between The Tax Rates and the FACT Table, which can be resolved using a concatenated or autonumber field for the Year and Tax Region fields, maintaining both fields in the more granular side.

Something like:

COMPANY:

Load [Company Name],

        [Company Region],

        [Region Group],

        [Company Division],

        [Company Location]

From ...;

MapCompanyRegion:

Mapping

Load [Company Name],

        [Company Region]

Resident COMPANY;

FACT:

Load Year & '|' [Company Region] as YearRegion,

        [Company Name],

       KEY,

       [Reporting Currency],

       Month,

       Amount;

Load Year,

        [Company Name],

        ApplyMap('MapCompanyRegion', [Comapny Name]) as [Company Region],

        KEY,

        [Reporting Currency],

        Month,

        Amount

From ...;

TaxRates:

Load Year& '|' & [Company Region]  as YearRegion,

        Year,

        [Company Region] as [Tax Region],

        [Tax Rate]

From ...;

I hope this will help you

Regards

Eduardo

Siva_Sankar
Master II
Master II

Sheetal,

There are many ways to avoid. Circular References

I have attached the example based on your attached image.

Regards,

siva sankar