Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Transaction with different products in one line

Hi everyone,


I am working on a table of transactions (sales). Every row referes to on product that has been bought. The person can buy many products. My goal is to have only one line for each person and add columns for the products that has been bought, knowing that a person can buy no more than 10 products.

I don't know how to make that table in Qlikview starting with an Excel file with a line per product bought.

Thank you.

11 Replies
Not applicable
Author

You can do row to column transpose... Post a sample file.

Not applicable
Author

Capture.PNG

Gysbert_Wassenaar

Create an additional field in the script using the autonumber function:

Temp:

LOAD [Transaction ID], Product FROM ...source... ;

Result:

LOAD

     [Transaction ID],

     Product,

     'Product ' & autonumber(RecNo(), [Transaction ID]) as ProductNo

RESIDENT Temp

ORDER BY [Transaction ID];

DROP TABLE Temp;

Create a pivot table with Transaction ID and ProductNo as dimensions and only(Product) as expression. Drag the ProductNo dimension to the right above the expression.


talk is cheap, supply exceeds demand
Not applicable
Author

As a biginner in Qlikview, I didn't understand the part when I have to create a pivot table. I also didn't understand what is the meaning of this syntax.'Product ' & autonumber(RecNo(), [Transaction ID]) as ProductNo

thank you for your answer

Gysbert_Wassenaar

You could of course just try it out to see what it does, but the line 'Product ' & autonumber(RecNo(), [Transaction ID]) as ProductNo will create the values 'Product 1', 'Product 2', ... etc for each product value it encounters per Transaction ID value.

A pivot table is a chart object that you create in the front end after loading the data into Qlikview. Chart objects are used to show data and results from calculations so users can see and interact with it.


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you very much.

Not applicable
Author

I tried the expression you gave me but it only gave me a blank table with no columns

Gysbert_Wassenaar

See attached example.


talk is cheap, supply exceeds demand
Not applicable
Author

Hello, I do not see the attached example, can u please load it?