Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone, I have a data model based on QVD files with a link table (not set up by myself). Everything works fine, however, there is now a requirement to filter the data being loaded into the application, so that it only pertains to a certain customer. What is the best way to filter at the application level? Is it just the standard way with table joins etc or is there another way in Qliksense? Thanks.
"Alternatively, you could apply a Left Join when loading those QVDs."
Did you mean a "Left Keep"?
-Rob
@NormanStanleyBadger I guess there are many ways.
1) ODAG (On demand App generation)
2) Section Access
3) Loop and reduce etc.
If you want to restrict the data being loaded, and it's coming from a QVD, the best way to filter is to only load the relevant data from the QVD using an Exists() condition to keep the load optimized, e.g.
Load * INLINE [
Customer
YourCustomerNameHere
];
Load Customer, Item, Quantity, Value
From YourFile.qvd
Where Exists(Customer);
Thanks for the responses guys, I will check out those ideas.
I have a time restraint, so an in app solution would be best. The Where Exists sounds promising but I also have a couple of dimension tables that are not directly related to the customer. For example, consumer details, only the consumers that purchased this customer's product are relevant, but my current QVD contains all consumer details.
You can switch those over to the same logic:
Load * From Transactions.qvd Where Exists(Customer);
Load * from Consumers.qvd Where Exists(Item); // Assuming Item is the key field and is listed in Transactions
etc.
Alternatively, you could apply a Left Join when loading those QVDs.
"Alternatively, you could apply a Left Join when loading those QVDs."
Did you mean a "Left Keep"?
-Rob
Thanks again, guys, Left Keep works a treat in testing, but it isn't working for me within the constraints of my data model where all the QVD tables are joined via a link table. The script for this is held outside my front end app, so I have requested a copy. Do you think this could be problem or am I missing something else?