Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm having troubles sorting my object extension by another dimension.
When i try and resort by dimension 2 for example i call:
_this.Layout.SetProperty('Chart.Dimension.2.Sort.PrimarySort.Use', '1', false);
_this.Layout.SetProperty('Chart.Dimension.2.Sort.PrimarySort', '4', true);
but nothing happens.
Is this the correct way to sort? If it is, why wouldn't these calls be working?
Thanks,
Eric
Hi,
Did you find an answer to your problem? I'm struggling with something very similar.
BR
-Christian
Hi Eric,
did you find an answer to your problem? I have unfortunately the same problem.
Regards
Heinz
As long as I know you must set it into definition.xml and can´t do this dynamic (Maybe I´m wrong)
<Initiate Name="Chart.Dimension.0.Sort.ByNumeric.Use" value="0"/> |
Another option would be to sort the data client side. This is pretty straight forward in QlikView because the data comes as a multi-dimensional array. Something like this -
sortData(1, "asc); function sortData(colIndex, order){ var aWin = order=="asc"?1:-1; var bWin = aWin * -1; _this.Data.Rows.sort(function(a,b){ if(a[colIndex].text > b[colIndex].text){ return aWin; } else if (a[colIndex].text < b[colIndex].text) { return bWin; } else{ return 0; } }); }
If you need to sort by more than 1 column then you'll need to expand on this logic.
I hope that helps.
Hello Nick,
thanks for your reply. Yes I know it´s possible to sort on the client side. But you have many rows to sort for example 50.000 and more it´s to much on the client side. I think the best way is to sort it by qlikview server and you get the sortet result set. I hope I find anyone a good solution.
Regards
Heinz