Your model has everything thrown together in a single table. That means that all lines with an OrderID occur twice:
- once from the invoices data
- once from the orders data
That is, they occur twice if there are corresponding invoices. For example ORD002 has no invoices, so no duplicates. Use Table Viewer->Preview to check your data.
Your solution is to use QlikView as ... QlikView: construct an associative model with a few tables and appropriate keys.
- Load and join orders and orderlines in a table and call this one Orders
- Load and join invoices and invoicelines in a second table and call this one Invoices.
- While loading this last table, give all fields a prefix to avoid linking them to the corresponding fields in Orders.
- Except for OrderID. That field should be used as a key tying the two together.
Teaching you how to write Load scripts would take me too far. But hey, QlikView has excellent Designer/Developer trainings that teach you how to master QlikView in a few days. Make sure to look into them if you want to do some serious development in QlikView.