<?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: using rowno() within a concat expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/using-rowno-within-a-concat-expression/m-p/376594#M140403</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the order of the State field in your pivot table is load order, you can use the same fieldIndex():&lt;BR /&gt;"concat(DISTINCT 'f' &amp;amp; State &amp;amp;','&amp;amp; &lt;STRONG&gt;fieldIndex('State', State)&lt;/STRONG&gt; &amp;amp; ',15', '|', fieldIndex('State', State)-1)"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not, you can make your State field dual in the script, so that BDF has numeric value 0, CAM - 1, ESS - 2, etc.&lt;BR /&gt;If you can do it in the script, the concat will be &lt;BR /&gt;"concat(DISTINCT 'f' &amp;amp; State &amp;amp;','&amp;amp; &lt;STRONG&gt;num(State)&lt;/STRONG&gt; &amp;amp; ',15', '|', fieldIndex('State', State)-1)"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Aug 2012 19:03:34 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-08-09T19:03:34Z</dc:date>
    <item>
      <title>using rowno() within a concat expression</title>
      <link>https://community.qlik.com/t5/QlikView/using-rowno-within-a-concat-expression/m-p/376593#M140402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've got a problem where i need to be able to have a sequential number appear within a concat expression based on the number of selections made within a field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, i have a field called State which has 30 values. In a straight table i could use the rowno(total) function to give me this as below;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="19626" class="jive-image" alt="table4.bmp" src="https://community.qlik.com/legacyfs/online/19626_table4.bmp" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, i need to show this as part of an expression which is in a text box. Expression is as follows;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"concat(DISTINCT 'f' &amp;amp; State &amp;amp;','&amp;amp; aggr(Distinct State,RowNo(Total)-1) &amp;amp; ',15', '|', fieldIndex('State', State)-1)"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see below, the concat function correctly wraps each of the States in the text, however, the sequential number doesn't show. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;fBDF,,15|fCAM,,15|fESS,,15|fHRT,,15|fLUT,,15|fNFK,,15|fPTE,,15|fSFK,,15&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm assuming this is because it's no longer in a table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there another way around this? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2012 13:28:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-rowno-within-a-concat-expression/m-p/376593#M140402</guid>
      <dc:creator />
      <dc:date>2012-08-09T13:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: using rowno() within a concat expression</title>
      <link>https://community.qlik.com/t5/QlikView/using-rowno-within-a-concat-expression/m-p/376594#M140403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the order of the State field in your pivot table is load order, you can use the same fieldIndex():&lt;BR /&gt;"concat(DISTINCT 'f' &amp;amp; State &amp;amp;','&amp;amp; &lt;STRONG&gt;fieldIndex('State', State)&lt;/STRONG&gt; &amp;amp; ',15', '|', fieldIndex('State', State)-1)"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not, you can make your State field dual in the script, so that BDF has numeric value 0, CAM - 1, ESS - 2, etc.&lt;BR /&gt;If you can do it in the script, the concat will be &lt;BR /&gt;"concat(DISTINCT 'f' &amp;amp; State &amp;amp;','&amp;amp; &lt;STRONG&gt;num(State)&lt;/STRONG&gt; &amp;amp; ',15', '|', fieldIndex('State', State)-1)"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2012 19:03:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-rowno-within-a-concat-expression/m-p/376594#M140403</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-09T19:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: using rowno() within a concat expression</title>
      <link>https://community.qlik.com/t5/QlikView/using-rowno-within-a-concat-expression/m-p/376595#M140404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunatelty, i need the number to be sequential from 0 upwards based on the selection. I've tried using the fieldIndex('State',State) before but it pulls in the value of that state in the whole list of states, so for example, with the selection used above i get;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="19712" class="jive-image" alt="table4.bmp" src="https://community.qlik.com/legacyfs/online/19712_table4.bmp" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly, i can't do it in the load in script as i need the values to be sequential, based on an alphabetical sort of the selections made.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps there anyway of using fieldindex using {$} to only base it on current selection?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2012 08:17:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-rowno-within-a-concat-expression/m-p/376595#M140404</guid>
      <dc:creator />
      <dc:date>2012-08-10T08:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: using rowno() within a concat expression</title>
      <link>https://community.qlik.com/t5/QlikView/using-rowno-within-a-concat-expression/m-p/376596#M140405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you can work out a solution by loading in your states in sorted alphabetically (i.e. load order = ordered alphabetically), then use something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=concat(DISTINCT 'f' &amp;amp; State &amp;amp;','&amp;amp; &lt;STRONG&gt;aggr(rowno(), State)&lt;/STRONG&gt; &amp;amp; ',15', '|', fieldIndex('State', State)-1)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The aggr() dimension values will be ordered by load order (should be alphabetical), and the aggr() expression returns the rowno(). Worked on my side. I don't think you need a sort weight in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2012 09:13:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-rowno-within-a-concat-expression/m-p/376596#M140405</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-10T09:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: using rowno() within a concat expression</title>
      <link>https://community.qlik.com/t5/QlikView/using-rowno-within-a-concat-expression/m-p/376597#M140406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome, thanks for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2012 09:17:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-rowno-within-a-concat-expression/m-p/376597#M140406</guid>
      <dc:creator />
      <dc:date>2012-08-10T09:17:10Z</dc:date>
    </item>
  </channel>
</rss>

