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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
D19PAL
Creator II
Creator II

Matching three values from rows

Hi Guys,

How do I create a flag for ID that matches three columns and values.

ID, COLOUR, SHAPE, SIZE

1, RED,SQUARE,SMALL

2, BLUE,TRIANGLE,LARGE

3,RED,SQUARE,SMALL

 

So I want something in the script to let me do this in in a table.

 

ID,count of matches

1,1

3,1

 

Thanks

1 Reply
MarcoWedel

One example using the AutoNumberHash128() function to generate a unique ID for each combination of properties, associating matching IDs in a separate table and thus enabling the dynamic calculation of matches based on current selections:

MarcoWedel_1-1644444707469.png

 

MarcoWedel_2-1644444725440.png

 

MarcoWedel_3-1644444770380.png

 

 

 

MarcoWedel_4-1644444877531.png

 

 

 

 

tabObjects:
LOAD *,
     AutoNumberHash128(COLOUR,SHAPE,SIZE) as PropertyID;
LOAD RecNo() as ID,
     Pick(Ceil(Rand()*4),'RED','BLUE','YELLOW','GREEN') as COLOUR,
     Pick(Ceil(Rand()*3),'SQUARE','TRIANGLE','CIRCLE') as SHAPE,
     Pick(Ceil(Rand()*3),'SMALL','MEDIUM','LARGE') as SIZE
AutoGenerate 30;

tabMatches:
LOAD PropertyID,
     ID as MatchID
Resident tabObjects;

 

 

 

hope this helps

Marco