Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
we have to use custom sorting in a textfield (something like countries), so we use the dual function to define that sorting order in the loadscript
also see how to use dual
I've create a sample app to simulate this behaviour with an following inline-load and 3 buttons
LOAD TextField
, Dual(TextField,NumberField) as TextField_sorted
, NumberField;
LOAD * Inline [
TextField, NumberField
A, 1
E, 2
D, 3
F, 4
B, 5
C, 6
];
As you can see, the sorting works as expected based on numeric value in the table with "TextField_sorted"
However, if i want to define an action on a sheet (or with a button), to select the value C in "TextField_sorted", it will not work.
First button, selects on "TextField" with a string, second button selects on "TextField_sorted" with a string (and does nothing), third button selects on "TextField_sorted" with a numeric value (6) and selects C
Now the question: if we want to select something based on a field, which is using custom sorting order with Dual, is there ANY WAY to make it work with the sorted field based on the String instead of the Numeric Value? (otherwise we'd have to duplicate the column to have it unsorted for selecting and sorted for display...)
Hi, what about "Select values matching search criteria" as action button? Try it instead of selecting value in field.
Hi, what about "Select values matching search criteria" as action button? Try it instead of selecting value in field.
Maybe you could skip the dual-stuff by using the load as a pre-load. Means loading the field-values with the appropriate order before loading your facts and dims and dropping this temporary table afterwards again. And then simply using the sort against the load-order.
thanks adam - this is what i was looking for!
the other option with a pre-load seems a little overkill and has to be maintained for each field, that requires a static sorting order
one more remark: if multiple values (e.g. 'C' and 'D') should be used, the syntax is different - took me a few minutes to figure it out and it's worthwile adding to the post for future reference 🙂
='(C|D)'