Search code examples
sortingspotfire

spotfire crosstable sorting


I have a very typical requirement to sort columns in the cross table. I have col1,col2,col3 columns. when col2=col3 it should display first

enter image description here.

Please let me know whether it can be achieved in Spotfire directly or through scripting.


Solution

  • I do not know of any straight forward way of defining a sort order like this, but in the past I have padded column values with a leading space so they come first when sorted.

    Something like this should work

    <[COL1] NEST [COL2] NEST CASE  WHEN [COL2]=[COL3] THEN Concatenate(" ",[COL3]) ELSE [COL3] END AS [COL3]>