<?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 Field Contains Value from another Field Creating a Unique Group &amp;amp; Flag in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Field-Contains-Value-from-another-Field-Creating-a-Unique-Group/m-p/2490828#M102021</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;So basically I have a [Control ID] field which is made up of several fields, one field being an [Account Number], so [Control ID], looks like this xxxx[Account Number]xxxx.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I need to create a count for all [Control ID] which [Account Number] appears in more than once, and then group them into one unique value.&lt;/P&gt;
&lt;P&gt;i.e. looks like this&lt;/P&gt;
&lt;TABLE width="277"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="110"&gt;Control ID&lt;/TD&gt;
&lt;TD width="167"&gt;Account Number&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;14JT986701&lt;/TD&gt;
&lt;TD&gt;986701&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;9JT7344&lt;/TD&gt;
&lt;TD&gt;7344&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;67JT23453&lt;/TD&gt;
&lt;TD&gt;23453&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;62JT986701&lt;/TD&gt;
&lt;TD&gt;986701&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and want it to return this&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="487"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="110"&gt;Control ID&lt;/TD&gt;
&lt;TD width="167"&gt;Account Number&lt;/TD&gt;
&lt;TD width="105"&gt;Account Number Appears in No. of Control IDs&lt;/TD&gt;
&lt;TD width="105"&gt;Unique Account Groups&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;14JT986701&lt;/TD&gt;
&lt;TD&gt;986701&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;9JT7344&lt;/TD&gt;
&lt;TD&gt;7344&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;67JT23453&lt;/TD&gt;
&lt;TD&gt;23453&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;62JT986701&lt;/TD&gt;
&lt;TD&gt;986701&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
    <pubDate>Tue, 05 Nov 2024 13:13:12 GMT</pubDate>
    <dc:creator>DataWhisperer</dc:creator>
    <dc:date>2024-11-05T13:13:12Z</dc:date>
    <item>
      <title>Field Contains Value from another Field Creating a Unique Group &amp; Flag</title>
      <link>https://community.qlik.com/t5/App-Development/Field-Contains-Value-from-another-Field-Creating-a-Unique-Group/m-p/2490828#M102021</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;So basically I have a [Control ID] field which is made up of several fields, one field being an [Account Number], so [Control ID], looks like this xxxx[Account Number]xxxx.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I need to create a count for all [Control ID] which [Account Number] appears in more than once, and then group them into one unique value.&lt;/P&gt;
&lt;P&gt;i.e. looks like this&lt;/P&gt;
&lt;TABLE width="277"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="110"&gt;Control ID&lt;/TD&gt;
&lt;TD width="167"&gt;Account Number&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;14JT986701&lt;/TD&gt;
&lt;TD&gt;986701&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;9JT7344&lt;/TD&gt;
&lt;TD&gt;7344&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;67JT23453&lt;/TD&gt;
&lt;TD&gt;23453&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;62JT986701&lt;/TD&gt;
&lt;TD&gt;986701&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and want it to return this&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="487"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="110"&gt;Control ID&lt;/TD&gt;
&lt;TD width="167"&gt;Account Number&lt;/TD&gt;
&lt;TD width="105"&gt;Account Number Appears in No. of Control IDs&lt;/TD&gt;
&lt;TD width="105"&gt;Unique Account Groups&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;14JT986701&lt;/TD&gt;
&lt;TD&gt;986701&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;9JT7344&lt;/TD&gt;
&lt;TD&gt;7344&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;67JT23453&lt;/TD&gt;
&lt;TD&gt;23453&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;62JT986701&lt;/TD&gt;
&lt;TD&gt;986701&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Tue, 05 Nov 2024 13:13:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Field-Contains-Value-from-another-Field-Creating-a-Unique-Group/m-p/2490828#M102021</guid>
      <dc:creator>DataWhisperer</dc:creator>
      <dc:date>2024-11-05T13:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: Field Contains Value from another Field Creating a Unique Group &amp; Flag</title>
      <link>https://community.qlik.com/t5/App-Development/Field-Contains-Value-from-another-Field-Creating-a-Unique-Group/m-p/2491471#M102083</link>
      <description>&lt;P&gt;This does what you want for this specific example. If you have a lot of different Account Numbers you may get a problem with the last column.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;data:
load * inline [
Control ID	Account Number
14JT986701	986701
9JT7344	7344
67JT23453	23453
62JT986701	986701
] (delimiter is '\t';

left join(data)
load 
   *, 
   window(sum(wildmatch([Control ID], '*'&amp;amp;[Account Number]&amp;amp;'*')), [Account Number]) as [Account Number Appears in No. of Control IDs],
   chr(64+autonumber([Account Number])) as [Unique Account Groups]
resident data;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The window function is relatively new to Qlik Sense. The wildmatch function will return the number 1 if the account number exists within the Control ID, otherwise it returns 0. I am summing that, and the windows function makes sure that the resulting value is imprinted on each row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 18:02:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Field-Contains-Value-from-another-Field-Creating-a-Unique-Group/m-p/2491471#M102083</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2024-11-07T18:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Field Contains Value from another Field Creating a Unique Group &amp; Flag</title>
      <link>https://community.qlik.com/t5/App-Development/Field-Contains-Value-from-another-Field-Creating-a-Unique-Group/m-p/2491488#M102084</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/146840"&gt;@DataWhisperer&lt;/a&gt;&amp;nbsp; I think as your control ID is made of Account No itself you don't really need to search anything in control id. You can simply take a count of account number and create group using numbers in case you have more than 26 accounts&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Data:
load *,Window(count([Account Number]),[Account Number]) as [Account Number Appears in No. of Control IDs]
inline [
Control ID	Account Number
14JT986701	986701
9JT7344	7344
67JT23453	23453
62JT986701	986701 ] (delimiter is '\t');

New:
Load *,
     if([Account Number]&amp;lt;&amp;gt;Previous([Account Number]),
     rangesum(Peek('Unique Account Groups'),1),Peek('Unique Account Groups')) as [Unique Account Groups]
Resident Data
Order by [Account Number Appears in No. of Control IDs] desc,[Account Number];

Drop Table Data;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-11-07 205027.png" style="width: 887px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/173993iA140C9B361C08F58/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-11-07 205027.png" alt="Screenshot 2024-11-07 205027.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 20:52:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Field-Contains-Value-from-another-Field-Creating-a-Unique-Group/m-p/2491488#M102084</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2024-11-07T20:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: Field Contains Value from another Field Creating a Unique Group &amp; Flag</title>
      <link>https://community.qlik.com/t5/App-Development/Field-Contains-Value-from-another-Field-Creating-a-Unique-Group/m-p/2491634#M102086</link>
      <description>&lt;P&gt;Yes, that works&amp;nbsp;&lt;EM&gt;if&lt;/EM&gt; the Account Number&amp;nbsp;&lt;EM&gt;always&lt;/EM&gt; is part of the Control ID. That is the case in the given example, but I figure that a possibility is e.g. a pair Control ID=14KPQ and Account Number=2345 where there is no match.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/146840"&gt;@DataWhisperer&lt;/a&gt;&amp;nbsp;should provide some more information.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 08:27:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Field-Contains-Value-from-another-Field-Creating-a-Unique-Group/m-p/2491634#M102086</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2024-11-08T08:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Field Contains Value from another Field Creating a Unique Group &amp; Flag</title>
      <link>https://community.qlik.com/t5/App-Development/Field-Contains-Value-from-another-Field-Creating-a-Unique-Group/m-p/2491635#M102087</link>
      <description>&lt;P&gt;Be aware that in my example, the way I create the field&amp;nbsp;&lt;EM&gt;Unique Account Groups&lt;/EM&gt; has a risk; the values may not be consistent in different app reloads if new data is added to the table, since I'm using the autonumber function to generate the values that you want.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 08:29:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Field-Contains-Value-from-another-Field-Creating-a-Unique-Group/m-p/2491635#M102087</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2024-11-08T08:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: Field Contains Value from another Field Creating a Unique Group &amp; Flag</title>
      <link>https://community.qlik.com/t5/App-Development/Field-Contains-Value-from-another-Field-Creating-a-Unique-Group/m-p/2491690#M102089</link>
      <description>&lt;P&gt;Should work both in QV and QS. try below:&lt;/P&gt;
&lt;P&gt;Data:&lt;BR /&gt;LOAD [Control ID], &lt;BR /&gt;[Account Number]&lt;BR /&gt;FROM&lt;BR /&gt;[&lt;A href="https://community.qlik.com/t5/App-Development/Field-Contains-Value-from-another-Field-Creating-a-Unique-Group/td-p/2490828" target="_blank"&gt;https://community.qlik.com/t5/App-Development/Field-Contains-Value-from-another-Field-Creating-a-Unique-Group/td-p/2490828&lt;/A&gt;]&lt;BR /&gt;(html, codepage is 1252, embedded labels, table is @1);&lt;/P&gt;
&lt;P&gt;MapNum:&lt;BR /&gt;Mapping &lt;BR /&gt;Load Distinct [Account Number],&lt;BR /&gt;'{' &amp;amp; 1 &amp;amp; '}' as Count_Flag_Text&lt;BR /&gt;resident Data;&lt;/P&gt;
&lt;P&gt;Output:&lt;BR /&gt;Load *,&lt;BR /&gt;MapSubString('MapNum', [Control ID]) as MappedNum,&lt;BR /&gt;TextBetween(MapSubString('MapNum', [Control ID]), '{', '}') as Flag&lt;BR /&gt;resident Data;&lt;BR /&gt;drop table Data;&lt;/P&gt;
&lt;P&gt;left join(Output)&lt;BR /&gt;Group:&lt;BR /&gt;Load *, chr(64+autonumber([Account Number Appears in No. of Control IDs] &amp;amp; [Account Number])) as [Unique Account Groups];&lt;BR /&gt;Load [Account Number],&lt;BR /&gt;sum(Flag) as [Account Number Appears in No. of Control IDs]&lt;BR /&gt;Resident Output&lt;BR /&gt;group by [Account Number];&lt;/P&gt;
&lt;P&gt;drop fields MappedNum, Flag;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2490828 - Field Contains Value from another Field Creating a Unique Group &amp;amp; Flag.PNG" style="width: 555px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/174091i88C134ADB3C09381/image-size/large?v=v2&amp;amp;px=999" role="button" title="2490828 - Field Contains Value from another Field Creating a Unique Group &amp;amp; Flag.PNG" alt="2490828 - Field Contains Value from another Field Creating a Unique Group &amp;amp; Flag.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 11:36:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Field-Contains-Value-from-another-Field-Creating-a-Unique-Group/m-p/2491690#M102089</guid>
      <dc:creator>Qrishna</dc:creator>
      <dc:date>2024-11-08T11:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Field Contains Value from another Field Creating a Unique Group &amp; Flag</title>
      <link>https://community.qlik.com/t5/App-Development/Field-Contains-Value-from-another-Field-Creating-a-Unique-Group/m-p/2491692#M102090</link>
      <description>&lt;P&gt;Yeah, true. As in original post it is mention that control id is made up of Account number, so I assumed control id always matches with account number. Let's what&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/146840"&gt;@DataWhisperer&lt;/a&gt;&amp;nbsp;have to say&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 11:42:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Field-Contains-Value-from-another-Field-Creating-a-Unique-Group/m-p/2491692#M102090</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2024-11-08T11:42:51Z</dc:date>
    </item>
  </channel>
</rss>

