<?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: issue Count syntax - nested expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/issue-Count-syntax-nested-expression/m-p/1240044#M393940</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A couple approaches. Hopefully I have the right syntax for both. I tend to prefer like this, but I'm not very confident it will work here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Count({&amp;lt;jRec={"=jRec&amp;gt;FirstSortedValue({&amp;lt;Linie={31}&amp;gt;}jRec,mRec)"},Linie={31}&amp;gt;}jSEQN)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I believe the below is probably a more common approach, and I'm a bit more confident in it. It's also closer to what you were saying about experimenting with brackets. The brackets are just $(=...), which is dollar sign expansion. QlikView will evaluate what's in the $(=...) before it does anything else, and what's in there is your first expression, so it should come up with your first result of 1056. Then the results are literally inserted into the rest of the expression, which turns it into your second expression, and only then is the count evaluated. Since it is by then exactly the expression that was already working, it should return the same thing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Count({&amp;lt;jRec={"&amp;gt;$(=FirstSortedValue({&amp;lt;Linie={31}&amp;gt;}jRec,mRec))"},Linie={31}&amp;gt;}jSEQN)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 12 Nov 2016 01:12:34 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2016-11-12T01:12:34Z</dc:date>
    <item>
      <title>issue Count syntax - nested expression</title>
      <link>https://community.qlik.com/t5/QlikView/issue-Count-syntax-nested-expression/m-p/1240043#M393939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As beginner I am little confused with nested expressions:&lt;/P&gt;&lt;P&gt;I have to Count Sequenzes starting from a certain record.depending on a product line.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;FirstSortedValue&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Linie&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={31&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;jRec&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;mRec&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; finds my correct record Number -&amp;gt; 1056&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;jRec&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"&amp;gt;1056"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Linie&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={31}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;jSEQN&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; finds my correct quantity of Sequenzes ........ but how can I combine both in one command. If I replace "1056" with the FirstSortedValue command I got an error.I experimented with brackets .... but no idea.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Many thanks for a hint&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Nov 2016 00:43:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/issue-Count-syntax-nested-expression/m-p/1240043#M393939</guid>
      <dc:creator />
      <dc:date>2016-11-12T00:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: issue Count syntax - nested expression</title>
      <link>https://community.qlik.com/t5/QlikView/issue-Count-syntax-nested-expression/m-p/1240044#M393940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A couple approaches. Hopefully I have the right syntax for both. I tend to prefer like this, but I'm not very confident it will work here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Count({&amp;lt;jRec={"=jRec&amp;gt;FirstSortedValue({&amp;lt;Linie={31}&amp;gt;}jRec,mRec)"},Linie={31}&amp;gt;}jSEQN)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I believe the below is probably a more common approach, and I'm a bit more confident in it. It's also closer to what you were saying about experimenting with brackets. The brackets are just $(=...), which is dollar sign expansion. QlikView will evaluate what's in the $(=...) before it does anything else, and what's in there is your first expression, so it should come up with your first result of 1056. Then the results are literally inserted into the rest of the expression, which turns it into your second expression, and only then is the count evaluated. Since it is by then exactly the expression that was already working, it should return the same thing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Count({&amp;lt;jRec={"&amp;gt;$(=FirstSortedValue({&amp;lt;Linie={31}&amp;gt;}jRec,mRec))"},Linie={31}&amp;gt;}jSEQN)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Nov 2016 01:12:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/issue-Count-syntax-nested-expression/m-p/1240044#M393940</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2016-11-12T01:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: issue Count syntax - nested expression</title>
      <link>https://community.qlik.com/t5/QlikView/issue-Count-syntax-nested-expression/m-p/1240045#M393941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Second one works perfect! Many thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Nov 2016 01:39:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/issue-Count-syntax-nested-expression/m-p/1240045#M393941</guid>
      <dc:creator />
      <dc:date>2016-11-12T01:39:13Z</dc:date>
    </item>
  </channel>
</rss>

