Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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:
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