Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Let's say I have the following table:
LOAD
OrderID,
OrderDate,
CustomerID,
ProductID
Value
Resident <table>
Order By OrderDate
Is it possible in the above to randomly swap the field to order by?
Say it's OrderDate but in the next reload it can randomly order by CustomerID or ProductID.
How is it possible to do this? Any ideas?
May be like this (Have not tested this, but I think it should work):
LET vRand = Ceil(Rand() * 3);
LET vField = Pick($(vRand), 'OrderDate', 'CustomerID' , 'ProductID');
LOAD
OrderID,
OrderDate,
CustomerID,
ProductID
Value
Resident <table>
Order By $(vField);
May be like this (Have not tested this, but I think it should work):
LET vRand = Ceil(Rand() * 3);
LET vField = Pick($(vRand), 'OrderDate', 'CustomerID' , 'ProductID');
LOAD
OrderID,
OrderDate,
CustomerID,
ProductID
Value
Resident <table>
Order By $(vField);