The information in orders and invoices is typically stored at the header or line level in the database. However, when we display the sales value for a particular order on the UI, it is sometimes desired that all the products for an order are displayed in a single cell rather than on a separate line. The Concat()
function is helpful in such a case.
For this recipe, we will make use of an inline data load that gives sales information for orders. Load the following order line information in Qlik Sense:
Orders: LOAD * INLINE [ OrderID,Product, ProductID, Sales 101,Footwear, F21Lon, 120000 101,Tyres, T21Man, 150000 101,Mountain Bikes, MB32Lon, 195000 102,Road Bikes, RB12Bir, 225000 102,Chains, F21Lon, 140000 103,lubricant, T21Man, 56869 103,Mountain Bikes, MB32Lon, 195000 104,Road Bikes, RB12Bir, 65233 ]; LEFT JOIN LOAD OrderID, CONCAT(Product,',') as Products Resident Orders GROUP BY...