Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I'm having issues trying to get the sort order of the legend of my chart to match the sort order of the bars. As can be seen, it's currently not working.
I tried using a dual function with a response sorting key in order to solve the issue, but it's not working. I'm trying to use a dual function to combine the index into the field, but I'm having trouble getting it to work.
Here's a portion of my sorting key:
[SortingKey]:
Mapping Load Response, SortOrder
Inline
[
Response, SortOrder
'Strongly agree', 1
'Agree', 2
'Neither agree nor disagree', 3
'Disagree', 4
'Strongly disagree', 5
.....
'18-25', 1
'26-35', 2
'36-45', '3'
'46-55', 4
'56-65', 5
'65+', 6
.....
]
And then here's me trying to use the dual function, but as can be seen, it's not really working. For some values it seems like it's assigning random values from elsewhere in the table. And it sometimes behaves differently when using a number vs. a string as the alternative (for values not explicitly listed in my key.
[Group2Final]:
Load
Group2Response as Group2ResponseFinal
,ApplyMap('SortingKey', Group2Response, -99) as NumberSorting
,Dual(Group2Response, ApplyMap('SortingKey', Group2Response, -99)) as NumberCombined
,ApplyMap('SortingKey', Group2Response, 'abcde') as StringSorting
,Dual(Group2Response, ApplyMap('SortingKey', Group2Response, 'abcde')) as StringCombined
Resident Group2;
Any thoughts on why this could be? I can't figure out what I'm doing wrong with the dual function.