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

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Keerthi1234
Contributor III
Contributor III

Create a model using qvds

Hi,

1.I am trying to build a model which needs around 7 to 8 qvd's , From all these I need to build a final table which includes few fields from these qvd's , but I am confused on how to combine them, for now I have kept one as a fact table and with common column names I have used left join, but I see a lot of data mismatch, why is that. Shouldn't I use left join or how can I make it without any data mismatch, Please let me know on how to solve this issue

2. I have moved a few chart expressions to script , will that cause any problem?

Labels (1)
5 Replies
Vegar
MVP
MVP

Thank you for reaching out with this question. How to model my Qlik Sene app is a frequency asked question with many correct answers.

You're not very specific on what goes wrong in your approach, the Community need you to be specific in order to return specific answers. So I will give you some general suggestions.

Using a join approach for these qvds can be a good way forward, but be aware that joins are done on all shared dimension names available in the two tables when the join is performed. Meaning if you are attempting to join on the order_id field joining orders.qvd and order_lines.qvd then make sure that they don't have any other common field name such as last_modified_date or similar.

When performing joins then it is also important to know the relationship between the two tables. Are you expecting the data to grow in terms of row count or not? 

In a join the join is done on the exact same values. In case you are joining on a dual fields, then it is the numerical part, not the string parts, that is used for comparison. 

Lastly. Consider skipping the use of join when loading the data into qlik. The associative engine will create associations between the data sets automatically, similar to how a join would, but without the risk of expanding your row count by a badly designed join. The associations will be visible for you in the data model overview. This can be an effective way to check any unintended associations when preparing for using a join later on.

 

Good luck troubleshooting this.

If you need more specific help, then please try to scope down your issue with a simple example, attach screenshots, explain which result you get , and what you're expecting to get.

Keerthi1234
Contributor III
Contributor III
Author

Hi Vegar,

Thanks for replying on this, So my scenario is that I already have a table in a sheet with few measures and dimensions, now I need to move all those dimensions and measures into the load editor, for that the data is split across 7 to 8 qvd's , So I need to combine those and create a final table which is exactly same to that of the table that is already present in the sheet.

So I am loading one qvd as fact table and the rest with common keys I am left joining with the fact table and few extra dimensions also I am creating, after joining all the qvd's ,I create a final table with whichever final columns I need. But when I check the new table and old table the data is not matching there are more discrepency in this.

FactSales:
LOAD
OrderID,
OrderLineID,
OrderDate,
CustomerID,
ProductID,
StoreID,
Quantity,
UnitPrice,
DiscountAmount,
NetSalesAmount
FROM [lib://QVD/FactSales.qvd] (qvd);

LEFT JOIN (FactSales)
LOAD
ProductID,
SKU,
ProductName,
ProductCategory,
Brand,
StandardCost,
ListPrice
FROM [lib://Source1/ProductMaster.qvd] (qvd);

LEFT JOIN (FactSales)
LOAD
CustomerID,
CustomerName,
CustomerSegment,
EmailDomain,
Country,
StateProvince,
[Gross/NetSpend],
[Business],
If(
[Business] = 'Business'
AND [Gross/NetSpend] <> 'Gross Spend'
AND [Gross/NetSpend] <> 'Transfer to Business'
AND [Gross/NetSpend] <> 'Recoveries',
'Net Spend'
) AS [Net Spend],
City
FROM [lib://Source2/CustomerMaster.qvd] (qvd);

FinalTable:
OrderID,
OrderLineID,
CustomerName,
CustomerSegment,
EmailDomain,
ProductName,
ProductCategory,
Brand ,
[Net Spend]
 RESIDENT FactSales;
DROP [All tables];

So this is not the exact data which I am using but the pattern is similar, I need whatever present in the final table,but there are a lot of null values generating and data mismatches happening. The problem is I am not sure where I am going wrong and how to visualize the problem to understand it. Please let me know how can this be solved or the approach I am following is correct or not. I am aware that qlik will automatically take care of this association but there are cases where there is no common values, so I will be merging tables with common values and in turn joining that with the fact table .

Regards,
Keer


Vegar
MVP
MVP

The first thing I would check is the row count of (FactSales) in each steps of your series of joins. I assume you're expecting it to be stable and not grow.

Anurag_
Contributor
Contributor

Check for duplicate records,

Check distinct count of OrderID, CustomerID, ProductID in final table vs the source tables.

While joining tables , if some values are absent then null comes up.

Lets say count(ProductID) in FactSales.qvd is more than the count(ProductID) in ProductMaster.qvd  then the resultant table will have null values for fields of ProductMaster.qvd

Try out using a link table having OrderID, CustomerID, ProductID .

 

marcus_sommer

Much more powerful and without risks to change the number of records in regard of an unsuitable relationship would be Don't join - use Applymap instead - Qlik Community - 1467592.