<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Sort values into hypercube in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Sort-values-into-hypercube/m-p/1315260#M6685</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I know this may be late, but i believe that the qInterColumnSortOrder array is the order in which the columns are sorted. Therefore I&amp;nbsp; would suggest that you try [2], or something like [2,1,3,0] etc. Thanks David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Apr 2018 15:16:39 GMT</pubDate>
    <dc:creator>dmtomlins</dc:creator>
    <dc:date>2018-04-03T15:16:39Z</dc:date>
    <item>
      <title>Sort values into hypercube</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Sort-values-into-hypercube/m-p/1315259#M6684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I’m trying to sort my data with a hypercube. The final aim is to have a table ordered by value like this (example) :&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="151"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Variable 1 (Dimension)&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="151"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Variable 2 (Measure 1)&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="151"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;Variable 3 (Measure 2)&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="151"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Variable 4 (Measure 3)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="151"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Name 1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="151"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;50&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="151"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="151"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;100&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="151"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Name 2&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="151"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;90&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="151"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="151"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;150&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="151"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Name 3&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="151"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;20&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="151"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;3&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="151"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I’m able to sort the table based on Variable1 (dimension) or on Variable2 (first measure into the hypercube) thanks to “&lt;STRONG&gt;qInterColumnSortOrder&lt;/STRONG&gt;” :&lt;/P&gt;&lt;P&gt;- If it equal to [0,1], values are sorted based on dimensions (therefore, based on Variable 1).&lt;/P&gt;&lt;P&gt;- If it equal to [1,0], values are sorted based on measures (therefore, based on Measure 1).&lt;/P&gt;&lt;P&gt;How can I do if I want to sort my data based on the &lt;SPAN style="color: #3366ff;"&gt;second measure&lt;/SPAN&gt; and not based on the first measure?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your answers &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;To obtain this, my hypercube is constructed like this : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;app.createCube({&lt;/P&gt;&lt;P&gt;&amp;nbsp; qDimensions : [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {qDef : { &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qFieldDefs": Variable1},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; qOtherTotalSpec : {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qOtherSortMode": "OTHER_SORT_ASCENDING"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ],&lt;/P&gt;&lt;P&gt;&amp;nbsp; qMeasures : [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {qDef : {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; qDef : Variable2 Equation},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; qLabel : "sel_0",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; qSortBy : {"qSortByNumeric": -1}},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {qDef : { &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; qDef : Variable3 Equation},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; qLabel : "sel_1",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; qSortBy : {"qSortByNumeric": -1}},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {qDef : { &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; qDef : Variable4 Equation},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; qLabel : "sel_2",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; qSortBy : {"qSortByNumeric": -1}}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG&gt;qInterColumnSortOrder : [0,1],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; qInitialDataFetch : [{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; qHeight : q_height,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; qWidth : q_width}]&lt;/P&gt;&lt;P&gt;&amp;nbsp; }, function(reply) { /*-- Construction of table --*/ }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Apr 2021 07:56:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Sort-values-into-hypercube/m-p/1315259#M6684</guid>
      <dc:creator />
      <dc:date>2021-04-02T07:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: Sort values into hypercube</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Sort-values-into-hypercube/m-p/1315260#M6685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I know this may be late, but i believe that the qInterColumnSortOrder array is the order in which the columns are sorted. Therefore I&amp;nbsp; would suggest that you try [2], or something like [2,1,3,0] etc. Thanks David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2018 15:16:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Sort-values-into-hypercube/m-p/1315260#M6685</guid>
      <dc:creator>dmtomlins</dc:creator>
      <dc:date>2018-04-03T15:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: Sort values into hypercube</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Sort-values-into-hypercube/m-p/1315261#M6686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I could sort it by adding a SortExpression directly to the dimension definition itself&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;qDimensions : [{&lt;/P&gt;&lt;P&gt;qDef : { &lt;/P&gt;&lt;P&gt;qFieldDefs : ["Product Name"],&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;qSortCriterias: [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; qSortByExpression: -1,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; qExpression: {qv: "Sum(Sales)" }&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}],&lt;/P&gt;&lt;P&gt;qMeasures : [{&lt;/P&gt;&lt;P&gt;qDef : { qDef : "Sum(Sales)" }&lt;/P&gt;&lt;P&gt;},{&lt;/P&gt;&lt;P&gt;qDef : { qDef : "Column(1)*2" }&lt;/P&gt;&lt;P&gt;}],&lt;/P&gt;&lt;P&gt;//qInterColumnSortOrder : [0,1,2],&lt;/P&gt;&lt;P&gt;qInitialDataFetch : [{&lt;/P&gt;&lt;P&gt;qTop : 0,&lt;/P&gt;&lt;P&gt;qLeft : 0,&lt;/P&gt;&lt;P&gt;qHeight : 100,&lt;/P&gt;&lt;P&gt;qWidth : 4&lt;/P&gt;&lt;P&gt;}]&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2018 14:17:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Sort-values-into-hypercube/m-p/1315261#M6686</guid>
      <dc:creator>ChristofSchwarz</dc:creator>
      <dc:date>2018-08-07T14:17:15Z</dc:date>
    </item>
  </channel>
</rss>

