Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
madmax88
Creator II
Creator II

Change load in script

Hi qlik xperts,

I need to change to load script because of the data model.

One query loads directly the numbers. e.g.

Table1:
Load
Customer_ID,
Variable 1 as Cash,
Variable 2 as Income
From xy

second query loads the product and the margin

Table2:
Load
Customer_ID,
Product,
Margin
From z

 

The load from table 1 includes the cash and income by customer and table2 the margins by product and customer. There are 3 different products.

Goal for the user is that he can select a product and then it shows the cash, income and margin. How can I format table 1 for this? Margin is a third variable and cannot be calculated by cash and income

3 Replies
andoryuu
Creator III
Creator III

What problem are you experiencing with loading these tables as is and displaying the values? Are they not aggregating as expected? Can you post an example?
lorenzoconforti
Specialist II
Specialist II

You clearly can't (or at least not properly); Cash and Income relate to Customer_ID; Margin is the only element related to Product.

So, if you load the tables as they are they will be associated by Customer_ID. When you select a product you are also selecting all the customers that have bought that product; when you then sum Cash and Income you will be looking at values not just related to a product but to all the products bought by those customers

Your issue is either with the data structure or the understanding of the business requirement

madmax88
Creator II
Creator II
Author

yes, true...there are some probs in the data model