<?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: Create variables for each unique value in a field in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/SOLVED-Create-variables-for-each-unique-value-in-a-field/m-p/1831482#M68554</link>
    <description>&lt;P&gt;You can leverage the 2nd parameter in max function&lt;/P&gt;&lt;P&gt;=max([Incident Quarter]) //max quarter&lt;/P&gt;&lt;P&gt;=max(Incident Quarter], 2) //second max incident&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Aug 2021 15:21:53 GMT</pubDate>
    <dc:creator>stevejoyce</dc:creator>
    <dc:date>2021-08-26T15:21:53Z</dc:date>
    <item>
      <title>SOLVED Create variables for each unique value in a field</title>
      <link>https://community.qlik.com/t5/App-Development/SOLVED-Create-variables-for-each-unique-value-in-a-field/m-p/1831462#M68553</link>
      <description>&lt;P&gt;I'm trying to create a variable for each quarter ([Incident Quarter]) in a table (Incidents). For example, the most recent quarter would be $curr_Quarter, the previous quarter would be $curr_Quarter_min1, and $curr_Quarter_min2, etc. Any suggestions are welcomed.&amp;nbsp;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 16:15:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/SOLVED-Create-variables-for-each-unique-value-in-a-field/m-p/1831462#M68553</guid>
      <dc:creator>fishnumber2</dc:creator>
      <dc:date>2021-08-26T16:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create variables for each unique value in a field</title>
      <link>https://community.qlik.com/t5/App-Development/SOLVED-Create-variables-for-each-unique-value-in-a-field/m-p/1831482#M68554</link>
      <description>&lt;P&gt;You can leverage the 2nd parameter in max function&lt;/P&gt;&lt;P&gt;=max([Incident Quarter]) //max quarter&lt;/P&gt;&lt;P&gt;=max(Incident Quarter], 2) //second max incident&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 15:21:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/SOLVED-Create-variables-for-each-unique-value-in-a-field/m-p/1831482#M68554</guid>
      <dc:creator>stevejoyce</dc:creator>
      <dc:date>2021-08-26T15:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create variables for each unique value in a field</title>
      <link>https://community.qlik.com/t5/App-Development/SOLVED-Create-variables-for-each-unique-value-in-a-field/m-p/1831492#M68556</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/146379"&gt;@stevejoyce&lt;/a&gt;&amp;nbsp;. I think that'll help me get more than half way there! The number of quarters in the data set can vary so I want to keep the number of variables that I create dynamic. Would I need to first get the number of unique values, and write a loop to create the variables with the max function?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 15:32:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/SOLVED-Create-variables-for-each-unique-value-in-a-field/m-p/1831492#M68556</guid>
      <dc:creator>fishnumber2</dc:creator>
      <dc:date>2021-08-26T15:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create variables for each unique value in a field</title>
      <link>https://community.qlik.com/t5/App-Development/SOLVED-Create-variables-for-each-unique-value-in-a-field/m-p/1831507#M68557</link>
      <description>&lt;P&gt;Well how would you expect to use an unknown ("dynamic") number of variables?&lt;/P&gt;&lt;P&gt;I didn't understand how you were planning on using the variable in a table...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But yes that would work like you said with the loop.&amp;nbsp; BTW, for consistency and reusability if you do it,&amp;nbsp;&lt;SPAN&gt;max([Incident Quarter]&lt;STRONG&gt;&lt;FONT color="#339966"&gt;, 1&lt;/FONT&gt;&lt;/STRONG&gt;) //max quarter can be used (no parameter defaults to 1)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 16:08:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/SOLVED-Create-variables-for-each-unique-value-in-a-field/m-p/1831507#M68557</guid>
      <dc:creator>stevejoyce</dc:creator>
      <dc:date>2021-08-26T16:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: Create variables for each unique value in a field</title>
      <link>https://community.qlik.com/t5/App-Development/SOLVED-Create-variables-for-each-unique-value-in-a-field/m-p/1831511#M68558</link>
      <description>&lt;P&gt;Thank you, worked!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 16:15:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/SOLVED-Create-variables-for-each-unique-value-in-a-field/m-p/1831511#M68558</guid>
      <dc:creator>fishnumber2</dc:creator>
      <dc:date>2021-08-26T16:15:41Z</dc:date>
    </item>
  </channel>
</rss>

