Let’s say if I have a row with 3+ attributes A, B, C and other Attrs
row1: A=1, B=5, C=10, Other Attrs
row2: A=1, B=5, C=10, Other Attrs
row3: A=2, B=5, C=10, Other Attrs
row4: A=2, B=5, C=10, Other Attrs
row5: A=3, B=6, C=11, Other Attrs
row6: A=3, B=6, C=11, Other Attrs
So if I want to assign each row a group ID by combination of A, B, C, row1, row2 have same group id x, row 3 row 4 have group id y, row 5 row 6 have group id z.
A simple solution is:
group id = A * S + B * S^2 + C * S^3 (S is the max integer number)
But my problem is I need an algorithm to back out each of A, B, C value from group id
for example, I need to be able to back out A=1, B=5, C=10 from group id x solely
First, this would be enough:
To get back A, B, and C:
Where
/is integer division and%is modulo.