Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sorting in QlikView Extension Objects

Hi,

I've been trying for some time now to sort a column (Dimension data) in an extension object. The option isn't there in the (default) properties unless I change the type to Straight table, but then some functionality is lost in my object which is unacceptable.

The column is the first one as well when loaded. It's numeric data with four digits, 1101, 1102, ... , 1112 for example.. the order right now is based on a different field, and it doesn't matter if you bring it along or not... still the same order...

Is there anything you can write in the Definition.xml or an option in properties (if you write your own)? Has anyone had the same problem?

Thanks,

Albin

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

The Sort.ByFrequency didn't work as I wanted it to, but I checked out the qvprops.htm (that I've somehow missed in the SDK, but is of great use) and found Sort.ByNumeric that is what I wanted.

I put the sort setting in the Definition.xml instead to separate the content from the settings:

<Initiate Name="Chart.Dimension.0.Sort.ByNumeric.Use" value="1"/>

Thanks Alexander,

/Albin

View solution in original post

6 Replies
Alexander_Thor
Employee
Employee

Hey Albin,

You could add this to your script.js,

this.Layout.SetProperty('Chart.Dimension.0.Sort.ByFrequency.Use', '1', true);

For different sorting options check out qvprops.htm in the SDK where you will find all the extension properties.

Cheers,

Alex

Not applicable
Author

Hi,

The Sort.ByFrequency didn't work as I wanted it to, but I checked out the qvprops.htm (that I've somehow missed in the SDK, but is of great use) and found Sort.ByNumeric that is what I wanted.

I put the sort setting in the Definition.xml instead to separate the content from the settings:

<Initiate Name="Chart.Dimension.0.Sort.ByNumeric.Use" value="1"/>

Thanks Alexander,

/Albin

Alexander_Thor
Employee
Employee

Ah yes the ByFrequency was just an example

I'm still struggling myself to get that damn setting into the properties.qvpp so the user can choose for themself.

Not applicable
Author

I was curious as well, and tried a few times. One option is to list the options as radiobuttons

<tr>

     <td colspan="3" class="ToolProperty-Literal">

          Sorting:

     </td>

     <td colspan="2">

          By A->Z: <input name="ascii" type="radio" avq="edit:.Chart.Dimension.0.Sort.ByAscii.Use" value="0" />

                   <input name="ascii" type="radio" avq="edit:.Chart.Dimension.0.Sort.ByAscii.Use" value="1" /><br/>

          etc...

     </td>

</tr>

Haven't tested a lot with other sortings but it's a starting point

Not applicable
Author

Hi All,

May i know how we can get the values we can use for Initiate component in the xml file?

Is it possible to use sort by expression?

Many thanks!

Not applicable
Author

I used <Initiate Name="Chart.Dimension.0.Sort.ByNumeric.Use" value="1"/>, but it is not working.

Any ideas?

Here is my Definition.xml

<ExtensionObject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Definition.xsd" Label="SelectionMapCAFireBug" Description="SelectionMapCAFireBug" PageHeight="20">

          <Dimension DropTarget="1st Dimension" Initial="=PrescriberId"/>

          <Measurement DropTarget="Measure" Initial="" />

          <Measurement DropTarget="Measure" Initial="" />

          <Measurement DropTarget="Measure" Initial="" />

          <Measurement DropTarget="Measure" Initial="" />

          <Initiate Name="Chart.Title" value="Map"/>

          <Initiate Name="Chart.Expression.0.0.Definition" value="=Sum(Vials)"/>

          <Initiate Name="Chart.Expression.1.0.Definition" value="=Latitude"/>

          <Initiate Name="Chart.Expression.2.0.Definition" value="=Longitude"/>

          <Initiate Name="Chart.Expression.3.0.Definition" value="=ZipCode"/>

          <!-- !IMPORTANT: Set the initial size of the QV map-->

          <Initiate Name="Layout.Normal.Width" Value="500" />

          <Initiate Name="Chart.Dimension.0.Sort.ByNumeric.Use" value="0"/>

</ExtensionObject>