Matching sort order of legend and graph - dual function not working
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.
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.