Custom Dynamic sort in Bi Publisher
Issue faced by someone on forum
The data source can't be changed.
You got the data as xml, and you want to specify the data sorting.
Not in alphabetical order or numerical order, some arbitrary sort on particular column.
We are make use of sort and decode and convert the element into number and get in sorted order.
Looks possible and simple, but, one big hurdle over there, cannot use xsl 2.0, have to keep it simple.
Here comes the handy "boolean to number conversion".
We can make use of this here.
Have a look at the snapshot.
Look at the xml, status field is unsorted there.
Expected output as follows.
Status: Open
Status: Unresolveable
Status: Closed
Use the above sort.
The data source can't be changed.
You got the data as xml, and you want to specify the data sorting.
Not in alphabetical order or numerical order, some arbitrary sort on particular column.
We are make use of sort and decode and convert the element into number and get in sorted order.
Looks possible and simple, but, one big hurdle over there, cannot use xsl 2.0, have to keep it simple.
Here comes the handy "boolean to number conversion".
We can make use of this here.
Have a look at the snapshot.
Look at the xml, status field is unsorted there.
Expected output as follows.
Status: Open
Status: Unresolveable
Status: Closed
<?sort: (number(status='Open') * 1) + (number(status='Unresolveable') * 2) + (number(status='Closed') * 3);'ascending';data-type='number'?>
Use the above sort.
Comments