<?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: Problem with dynamic sort-expression in chart in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-dynamic-sort-expression-in-chart/m-p/438278#M163387</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=$(=only(sortExpr2)) seems to work, though I'm not sure how you could do the default selection.&lt;/P&gt;&lt;P&gt;See attached.&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Dec 2012 13:23:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-12-14T13:23:56Z</dc:date>
    <item>
      <title>Problem with dynamic sort-expression in chart</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-dynamic-sort-expression-in-chart/m-p/438277#M163386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;I have a chart in which I would like the way to sort being selected by the users.&lt;/P&gt;&lt;P&gt;The chart displays this data&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dim1, value&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A1, 10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A1, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A1, 11&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; B1, 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; B1, 36&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; C1,3&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a small inline table holding the name of the sorting-approach and the actual expression.&lt;/P&gt;&lt;P&gt;Like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SortTable:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sortName,sortExpr2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value, sum(value)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count,count(DISTINCT value)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Default,''&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I present the sortName-dimension in a listbox and would like to set the corresponding sortExpr2 as the sorting expression.&lt;/P&gt;&lt;P&gt;I tried this as the sort-expression in the chart:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only({&amp;lt;sortName = {$(=GetfieldSelections(SortName))}&amp;gt;} sortExpr2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but currently it doesn't even work in a text-box.&lt;/P&gt;&lt;P&gt;(I also tried with a cyclic dimension and the function-call replaced by getCurrentField(CyclicDim) and by then the expression above worked in a text-box but not as the sort-expression in the chart)&lt;/P&gt;&lt;P&gt;I've been fidling with this for hours and would like som help on the topic. What I'm I doing wrong?&lt;/P&gt;&lt;P&gt;I attach a very small example-application.&lt;/P&gt;&lt;P&gt;brgds&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2012 12:56:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-dynamic-sort-expression-in-chart/m-p/438277#M163386</guid>
      <dc:creator>andy</dc:creator>
      <dc:date>2012-12-14T12:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with dynamic sort-expression in chart</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-dynamic-sort-expression-in-chart/m-p/438278#M163387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=$(=only(sortExpr2)) seems to work, though I'm not sure how you could do the default selection.&lt;/P&gt;&lt;P&gt;See attached.&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2012 13:23:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-dynamic-sort-expression-in-chart/m-p/438278#M163387</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-14T13:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with dynamic sort-expression in chart</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-dynamic-sort-expression-in-chart/m-p/438279#M163388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great!&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;I solved the default like this (just setting the expression to an empty string)&lt;/P&gt;&lt;P&gt;=if(only(sortName)&amp;lt;&amp;gt;'Default',$(=only(sortExpr2)),'')&lt;/P&gt;&lt;P&gt;/Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2012 13:51:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-dynamic-sort-expression-in-chart/m-p/438279#M163388</guid>
      <dc:creator>andy</dc:creator>
      <dc:date>2012-12-14T13:51:51Z</dc:date>
    </item>
  </channel>
</rss>

