Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
twanqlik
Creator
Creator

Data model - avoiding loop?

I can use some help with my data model

I have 2 dimensions in my data model that are using the same field:

test.png

  1. Dim_SourceSystem
  2. Dim_BMC

The field that in both dimensions is used is: Business_Code

Renaming one of the fields is no option because:

- On the front-end the user should be able to filter on a business_code that will filter in both the dimensions.

How my calculation should work:

  1. User selects one or more business codes
  2. Qlikview calculates the count on [Distinct CONSUMER_ID] in the FACT_Consumer_Sell_Out table.

Linking the 2 Business_Code fields results in a loop. I currently have no idea how to fix this. Help

Background:

a) product registrations are linked to a business code

b) the used source code is sometimes also linked to a business code

A consumer can have a product registration, the product registration is linked to a Business_Code

A consumer registration has always a source code, and a Business_Code is sometimes linked to a source code.

The user wants to know how many consumers belong to his Business Code, that are consumers with and without a product registration.

8 Replies
marcus_sommer

I think I would transfer Business_Code into the fact-table probably with one (or two nested) mapping(s) and applymap() and removing them from the dimension-tables.

- Marcus

spividori
Specialist
Specialist

Hi.

Could you attach an excel sheet with data to help you ?.

Regards.

twanqlik
Creator
Creator
Author

Yes of course, please find attached a sample

jcampbell474
Creator III
Creator III

Please reload the attached.

twanqlik
Creator
Creator
Author

Thank you Jason, however i don't see any difference in your attachment?

jcampbell474
Creator III
Creator III

I commented out your script and added Tab 2 in the Script Editor.  I can't reload because I don't have the source data.

spividori
Specialist
Specialist

Hi.

See the attachment. Hope this helps.

Regards.

twanqlik
Creator
Creator
Author

Thanks Sandro, but it's not completely working.

When I select consumerID 8 none of the business unit codes are selected, but the business unit code '0368' should be selected.

Any ideas on how to improve?