<?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 a flag in script with group by in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-a-flag-in-script-with-group-by/m-p/1096355#M640705</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Swuehl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U just answered the question directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function i need to use is Index(Only) for the req.&lt;/P&gt;&lt;P&gt;It worked.&lt;/P&gt;&lt;P&gt;Thank you &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Mar 2016 22:47:17 GMT</pubDate>
    <dc:creator>markgraham123</dc:creator>
    <dc:date>2016-03-04T22:47:17Z</dc:date>
    <item>
      <title>Create a flag in script with group by</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-flag-in-script-with-group-by/m-p/1096351#M640701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working on a requirement where i need to create a flag grouping by Order with respect to the value in it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LOAD [Order No],&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt; if(match(MaxString(Inst), 'PT') OR&amp;nbsp; Index(Indicator,'PP'), 'Y', 'N') as Flag&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt; Resident Table1&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt; Group By [Order No];&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P&gt;The problem is, 'PP' is not the MaxString(Value) for the filed and hence it is not fetching me the req. value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using only Max(String) as i have to always group by Order No.&lt;/P&gt;&lt;P&gt;Can someone pls help here.&lt;/P&gt;&lt;P&gt;Any function similar to MaxString() works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 22:36:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-flag-in-script-with-group-by/m-p/1096351#M640701</guid>
      <dc:creator>markgraham123</dc:creator>
      <dc:date>2016-03-04T22:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Create a flag in script with group by</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-flag-in-script-with-group-by/m-p/1096352#M640702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Not sure why you need a MaxString here Mark?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 22:41:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-flag-in-script-with-group-by/m-p/1096352#M640702</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-03-04T22:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create a flag in script with group by</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-flag-in-script-with-group-by/m-p/1096353#M640703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I don't really get what you want to achieve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why do you group by order no, since there seems to be only 1 record per order no?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And why is MaxString(Value) not working for&amp;nbsp; Indicator field?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use a group by clause, you would need aggregation functions for all fields not listed in the clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use Only() as aggregation if that's appropriate:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(match(MaxString(Inst), 'PT') OR&amp;nbsp; Index(&lt;STRONG&gt;Only&lt;/STRONG&gt;(Indicator),'PP'), 'Y', 'N') as Flag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 22:43:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-flag-in-script-with-group-by/m-p/1096353#M640703</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-03-04T22:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Create a flag in script with group by</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-flag-in-script-with-group-by/m-p/1096354#M640704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sunny,.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because i want to group it by Order No. as per my original data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 22:44:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-flag-in-script-with-group-by/m-p/1096354#M640704</guid>
      <dc:creator>markgraham123</dc:creator>
      <dc:date>2016-03-04T22:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Create a flag in script with group by</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-flag-in-script-with-group-by/m-p/1096355#M640705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Swuehl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U just answered the question directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function i need to use is Index(Only) for the req.&lt;/P&gt;&lt;P&gt;It worked.&lt;/P&gt;&lt;P&gt;Thank you &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 22:47:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-flag-in-script-with-group-by/m-p/1096355#M640705</guid>
      <dc:creator>markgraham123</dc:creator>
      <dc:date>2016-03-04T22:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create a flag in script with group by</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-flag-in-script-with-group-by/m-p/1096356#M640706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is only one Order No. only in the attached sample. Do you have duplicate in your real database? Would you be share a sample which is more representative of the actual data. Also share the expected result if possible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 22:47:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-flag-in-script-with-group-by/m-p/1096356#M640706</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-03-04T22:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create a flag in script with group by</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-flag-in-script-with-group-by/m-p/1096357#M640707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like you have more than one row per order. I think concat() would be any easier approach:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD [Order No],&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(wildmatch(concat(Inst,','), '*PT*') &lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;OR &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;wildmatch(concat(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;Indicator&lt;/SPAN&gt;,','), '*PP*')&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;, 'Y', 'N') as Flag&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Resident Table1&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Group By [Order No];&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com" rel="nofollow" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://qlikviewcookbook.com" rel="nofollow" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 23:03:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-flag-in-script-with-group-by/m-p/1096357#M640707</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2016-03-04T23:03:49Z</dc:date>
    </item>
  </channel>
</rss>

