<?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 Dynamic sorting on pivot Table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dynamic-sorting-on-pivot-Table/m-p/194882#M55623</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you don't want sort a calculated dimension you should check the pivot table box API. I think that in the property class there is something to set up the sort order (usually the API realize by functions what we can see on the object property window).&lt;/P&gt;&lt;P&gt;I checked the API, I didn't find something specific for Pivot table...what you can try is to modify the default sort criteria for a specific field...I don't know if it works, but you can make a try:&lt;/P&gt;&lt;P&gt;set fld=ActiveDocument.GetField("Salesman")&lt;BR /&gt;set fldsrt = fld.GetDefaultSortCriteria&lt;BR /&gt;fldsrt.SortByExpression = 1&lt;BR /&gt;fldsrt.Expression.v = "sum(Amount)"&lt;BR /&gt;fld.SetDefaultSortCriteria fldsrt&lt;/P&gt;&lt;P&gt;If you must sort a calculated dimension your target is harder to reach..I think the only solution is to calculate the dimension in the script pahse (so it isn't anymore a calculated dimension).&lt;/P&gt;&lt;P&gt;If the macro doesn't work you also try to build in the script a set of preordered dimensions and by macro each time you press a button you rebuild the table with the appropriate dimension. (you also build serveral table, each one preordered by a specific criteria and by a macro set the "visible" property, so you can always display the correct ordered table; the drawback is that you have to maintain several table: one for each sort criteria).&lt;/P&gt;&lt;P&gt;I hope these tips can help you&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matteo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Nov 2010 08:02:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-11-22T08:02:30Z</dc:date>
    <item>
      <title>Dynamic sorting on pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-sorting-on-pivot-Table/m-p/194879#M55620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me in Dynamic sorting on pivot Table like stright table ,where ever we clik on table cols, data has to sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;srini&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Nov 2010 14:47:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-sorting-on-pivot-Table/m-p/194879#M55620</guid>
      <dc:creator />
      <dc:date>2010-11-19T14:47:32Z</dc:date>
    </item>
    <item>
      <title>Dynamic sorting on pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-sorting-on-pivot-Table/m-p/194880#M55621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Calculated dimensions can be sorted only by alfabetical order or loading order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want something more complex you can try to set up a macro that runs your ordering algorithm and try to write the value in the cells, but I don't know if it works...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Nov 2010 15:26:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-sorting-on-pivot-Table/m-p/194880#M55621</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-11-19T15:26:48Z</dc:date>
    </item>
    <item>
      <title>Dynamic sorting on pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-sorting-on-pivot-Table/m-p/194881#M55622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Thx for reply,&lt;/P&gt;&lt;P&gt;hey can u please guide me to how can achive this writing macro? do you have any example...&lt;/P&gt;&lt;P&gt;thanks once agian.&lt;/P&gt;&lt;P&gt;srini&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Nov 2010 07:11:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-sorting-on-pivot-Table/m-p/194881#M55622</guid>
      <dc:creator>srinivasa1</dc:creator>
      <dc:date>2010-11-22T07:11:52Z</dc:date>
    </item>
    <item>
      <title>Dynamic sorting on pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-sorting-on-pivot-Table/m-p/194882#M55623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you don't want sort a calculated dimension you should check the pivot table box API. I think that in the property class there is something to set up the sort order (usually the API realize by functions what we can see on the object property window).&lt;/P&gt;&lt;P&gt;I checked the API, I didn't find something specific for Pivot table...what you can try is to modify the default sort criteria for a specific field...I don't know if it works, but you can make a try:&lt;/P&gt;&lt;P&gt;set fld=ActiveDocument.GetField("Salesman")&lt;BR /&gt;set fldsrt = fld.GetDefaultSortCriteria&lt;BR /&gt;fldsrt.SortByExpression = 1&lt;BR /&gt;fldsrt.Expression.v = "sum(Amount)"&lt;BR /&gt;fld.SetDefaultSortCriteria fldsrt&lt;/P&gt;&lt;P&gt;If you must sort a calculated dimension your target is harder to reach..I think the only solution is to calculate the dimension in the script pahse (so it isn't anymore a calculated dimension).&lt;/P&gt;&lt;P&gt;If the macro doesn't work you also try to build in the script a set of preordered dimensions and by macro each time you press a button you rebuild the table with the appropriate dimension. (you also build serveral table, each one preordered by a specific criteria and by a macro set the "visible" property, so you can always display the correct ordered table; the drawback is that you have to maintain several table: one for each sort criteria).&lt;/P&gt;&lt;P&gt;I hope these tips can help you&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matteo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Nov 2010 08:02:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-sorting-on-pivot-Table/m-p/194882#M55623</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-11-22T08:02:30Z</dc:date>
    </item>
  </channel>
</rss>

