Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi QlikViewer's,
I have a table box which is populated by a macro using the field selections a user wants. But the order of the fields displayed would be in the alphabetical order. i.e., I have two 4 fields.
Name | Age | Region | Mobile |
---|---|---|---|
Subin | 25 | India | 9900 |
George | 26 | USA | 8899 |
Thomas | 28 | China | 7898 |
So, a user selects, Name & Age as the fields to be displayed - first selection on Name & then on Age
then both the fields would be displayed as below,
Age | Name |
---|---|
25 | Subin |
26 | George |
28 | Thomas |
As you see the above order, the fields are displayed in Alphabetical order. How can we achieve to get the load order. i.e., First Name field should be shown and then Age Field.
Regards,
Subin
If you want build the tablebox with a user-defined field-order you will need to store the selected values into a variable, something like:
varFieldOrder = '$(varFieldOrder)' & getfieldselections(YourFieldListbox, '|') & '|' &
then you could loop through these variable. But you will need some more logic to clear the variable after creating the tablebox and handle any errors. Easier could be to create such field-order by the tablebox in steps - first step: tablebox wille be created with the first field, second/third ... step will be to append field after field.
THe easiest way would be the user adjust the tablebox by drag 'n drop ...
- Marcus
Hi Marcus, I got your idea of storing the user selected fields in a variable. But how can I loop it to be visible to the users in a table box?
You could use inside the vbs the split() function with the delimiter "|" to create an array through which you could loop.
- Marcus
Hi Marcus, When tried to get the getFieldSelections with the field, the values gets sorted again in alphabetical order.
It was meant for a step by step selection and each single selection will be concatenated to the variable-value. Will be several field-values selected at once then there won't be any possibilty to track a order - it will be ordered alphabetically.
- Marcus