Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm creating a HeatMap chart with two dimensions and one measure. I want to sort each dimension with a known condition sort_dim, so I'm trying to use Dual(dim1, sort_dim) function to do it.
If I edit the dimension from dim1 to sort_dim&' | '&dim1 (just to see both the dimension and the sort condition in the chart) and I sort alphabetically, it works. I can see in the dimension the sort_dim to sort each dim1 and, as it is in the begining of the dimension, it sorts well. However, if I set the dimension as mentioned Dual(dim1, sort_dim), the HeatMap chart shows dim1 but not in the same order. How can it be possible? I thought the second part of Dual function was used to sort.
If it is not clear, an example of what is happening:
Dual('A',2), Dual('B',1), Dual('C',3) -->sorted alphabetically--> 'C', 'B', 'A' (e.g, unknown way of sorting)
2&' | '&'A', 1&' | '&'B', 3&' | '&'C' -->sorted alphabetically--> '1 | B', '2 | A', '3 | C'
You couldn't use dual() within a sorting-expression because it returns the string-part of the value. You may apply num(dual()) to access the numeric part but it's superfluous because you could just set sort_dim for it.
- Marcus