Qlik Community

QlikView Extensions

Discussion Board for collaboration on QlikView Extensions.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
ericpark
New Contributor

Qlikview Extension Sorting

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

Tags (2)
5 Replies
celindho
Contributor

Re: Qlikview Extension Sorting

Hi,

Did you find an answer to your problem? I'm struggling with something very similar.

BR

-Christian

Not applicable

Re: Qlikview Extension Sorting

Hi Eric,

did you find an answer to your problem? I have unfortunately the same problem.


Regards

Heinz

Employee
Employee

Re: Qlikview Extension Sorting

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"/>

https://help.qlik.com/en-US/qlikview-developer/12.0/Subsystems/Extensions/Content/extensions-propert...

Luminary
Luminary

Re: Qlikview Extension Sorting

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.

Not applicable

Re: Qlikview Extension Sorting

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

Community Browser