Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
I'm trying to build this table, where random numbers (range between 1 and 7) are generated, but they must be unique within same row:
customer | num1 | num2 | num3 |
a | 1 | 5 | 4 |
b | 4 | 3 | 2 |
c | 7 | 1 | 4 |
d | 1 | 5 | 6 |
e | 4 | 6 | 1 |
f | 6 | 3 | 1 |
I'd like to assign these random numbers to 'customer' dimension of table 'customers'. How do I acchieve that in my script? Any help would be appreciated.
Best regards,
Jose.
Hi Jose,
How random should it be? Because you can get RowNo() and the sequential number would give an unique number for each row. You can subtract or add numbers to create different numbers.
Also you can resident load it in descending order and add another RowNo().
Another possibility is creating a rand() function, sort on this rand function and add RowNo().
All these possibilities give you unique numbers for each customer.
Jordy
Climber