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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do i script to select only the first record of the first dimension when other two dimensions can make record unique

i have a file with 200k records and multiple fields (see attached item master QVD) and want to load only three fields below

[Part number]

[Item Status]

[Commodity Code]

My desired result is, part number sorted ascending, status sorted ascending and commodity code

but i only want to select the first record for each part number.

My output will only have one part number, the first status code associated with that part number and the commodity code associated with that part number.

below is desired result

Part Number Item Status Commodity Code
6551-2461093





However there can be many status combinations and commodity code combinations for One Part number. Although there can be many combinations for one part number i am only concerend with the selecting the first record of a part number once each of the above three fields have been sorted ascending.

I have tried to load my QVD, sort the above three fields ascending and then isolate the resident table but need some help as i am still very new to Qlikveiw. Previously i dont think that i clarified my question.

Attached is my QVW and my Item Master QVD

the below is are the current results that i am getting

Part Number Item Status Commodity Code
6551-2461093
6551-2464OBP
6551-2464093


or

Part NumberItem StatusCommodity Code
6551-2461093
6551-2464OBP





as you can see my current results would be fine if i wanted all combinations for each part but i want to select only the first record regardless of all possible combinations, if the three fileds are sorted ascending then by selecting the first record for each part, i will achieve my desired output


11 Replies
Not applicable
Author

Hi

i have attached file here...

hoe it will help you out..

Not applicable
Author

Sampath thank you for your help this will be very useful and helpful.

Gopinathan thank you for your help,

i just implemented your input and my problem has been resolved.

I thought that maybe flagging unique or duplicates could be part of the answer but didn't know how best to set up.

Hope this helps others who run into similar issues.