<?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: Flag creation in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827416#M68087</link>
    <description>&lt;P&gt;Could you please help me on the same?&lt;/P&gt;</description>
    <pubDate>Mon, 09 Aug 2021 09:57:20 GMT</pubDate>
    <dc:creator>ksk278074</dc:creator>
    <dc:date>2021-08-09T09:57:20Z</dc:date>
    <item>
      <title>Flag creation</title>
      <link>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827377#M68080</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;I want to create the flag based on the 3 fileds.&lt;/P&gt;&lt;P&gt;1.creation date ,region and ID&lt;/P&gt;&lt;P&gt;If i have multiple created dates&amp;nbsp; for the same region and same ID then my flag will be Y else N&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please hlep me how to create the flag for the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,Siva&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 18:17:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827377#M68080</guid>
      <dc:creator>ksk278074</dc:creator>
      <dc:date>2021-11-30T18:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Flag creation</title>
      <link>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827416#M68087</link>
      <description>&lt;P&gt;Could you please help me on the same?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 09:57:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827416#M68087</guid>
      <dc:creator>ksk278074</dc:creator>
      <dc:date>2021-08-09T09:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: Flag creation</title>
      <link>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827417#M68088</link>
      <description>&lt;P&gt;&lt;BR /&gt;//dummy data&lt;BR /&gt;tbl:&lt;BR /&gt;load * inline [&lt;BR /&gt;id, creation date, region&lt;BR /&gt;123, 1/1/2021, abc&lt;BR /&gt;123, 1/3/2021, abc&lt;BR /&gt;780, 1/3/2021, dec&lt;/P&gt;&lt;P&gt;]&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;//preceding load:&lt;BR /&gt;//first count creation dates for each id and region&lt;BR /&gt;//second left join to original table as a flag if &amp;gt; 1&lt;/P&gt;&lt;P&gt;left join (tbl)&lt;BR /&gt;load&lt;BR /&gt;id&lt;BR /&gt;,region&lt;BR /&gt;,if(count_creationdate_by_id_region&amp;gt;1, 'Y', 'N') as flag_multiple_create_dates_by_id_region&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;load distinct&lt;BR /&gt;id&lt;BR /&gt;,region&lt;BR /&gt;,count(distinct [creation date]) as count_creationdate_by_id_region&lt;BR /&gt;resident tbl&lt;BR /&gt;group by id, region&lt;BR /&gt;;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 10:02:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827417#M68088</guid>
      <dc:creator>stevejoyce</dc:creator>
      <dc:date>2021-08-09T10:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Flag creation</title>
      <link>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827427#M68091</link>
      <description>&lt;P&gt;HI Stevejoyce,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried with your approach but did not get the data for flag.&lt;/P&gt;&lt;P&gt;Could you please explain bit clear?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 10:39:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827427#M68091</guid>
      <dc:creator>ksk278074</dc:creator>
      <dc:date>2021-08-09T10:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Flag creation</title>
      <link>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827429#M68093</link>
      <description>&lt;P&gt;so let's get rid of the preceeding load for now so you can step through it and see where it's not matching what it should:&lt;/P&gt;&lt;P&gt;1st step is to count distinct creation dates grouped by id &amp;amp; region combination.&lt;/P&gt;&lt;P&gt;2nd is taking this count and assigning Y when &amp;gt;1 else N&lt;/P&gt;&lt;P&gt;3rd is joining that back to your original table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Get count of creation dates for each id+region&lt;/P&gt;&lt;P&gt;tempTbl:&lt;/P&gt;&lt;P&gt;load distinct&lt;BR /&gt;id&lt;BR /&gt;,region&lt;BR /&gt;,count(distinct [creation date]) as count_creationdate_by_id_region&lt;BR /&gt;resident tbl&lt;BR /&gt;group by id, region&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//exit script&lt;/P&gt;&lt;P&gt;//is this correct?&amp;nbsp; if so...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//create your flag logic&lt;/P&gt;&lt;P&gt;temp2Tbl:&lt;/P&gt;&lt;P&gt;load&lt;BR /&gt;id&lt;BR /&gt;,region&lt;BR /&gt;,if(count_creationdate_by_id_region&amp;gt;1, 'Y', 'N') as flag_multiple_create_dates_by_id_region&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;resident&amp;nbsp;tempTbl;&lt;/P&gt;&lt;P&gt;drop table&amp;nbsp;tempTbl;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//is this correct? if so then...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;left join (tbl)&lt;/P&gt;&lt;P&gt;load *&lt;/P&gt;&lt;P&gt;resident&amp;nbsp;temp2Tbl;&lt;/P&gt;&lt;P&gt;drop table&amp;nbsp;temp2Tbl;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 10:45:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827429#M68093</guid>
      <dc:creator>stevejoyce</dc:creator>
      <dc:date>2021-08-09T10:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Flag creation</title>
      <link>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827430#M68094</link>
      <description>&lt;P&gt;In addition to that, i am attaching the sample data file.&lt;/P&gt;&lt;P&gt;for the file need to create the flag if you have multiple created dates for id and region.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 10:45:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827430#M68094</guid>
      <dc:creator>ksk278074</dc:creator>
      <dc:date>2021-08-09T10:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Flag creation</title>
      <link>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827447#M68098</link>
      <description>&lt;P&gt;Can you explain your issue?&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;group by id, region is what is creating the flag based on id and region.&amp;nbsp; Not sure what i need to use the sample xlsx file for.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tested the script against the xlsx file.&amp;nbsp; Works as expected to me.&amp;nbsp; If you can explain what you've done and what is not working.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 11:54:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827447#M68098</guid>
      <dc:creator>stevejoyce</dc:creator>
      <dc:date>2021-08-09T11:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: Flag creation</title>
      <link>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827472#M68101</link>
      <description>&lt;P&gt;This works!&lt;/P&gt;&lt;P&gt;Another option can be as below in scenarios where the data set is very large:&lt;/P&gt;&lt;P&gt;tbl:&lt;BR /&gt;LOAD&lt;BR /&gt;autonumber(ID&amp;amp;Region) as IDRegnKey,&lt;BR /&gt;ID,&lt;BR /&gt;Region,&lt;BR /&gt;[Created date],&lt;BR /&gt;[closed date]&lt;BR /&gt;FROM&lt;BR /&gt;Test.xlsx&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;left Join (tbl) load&lt;BR /&gt;IDRegnKey,&lt;BR /&gt;if(CntCreateDt&amp;gt;1, 'Y', 'N') as Flag_IDRegn;&lt;/P&gt;&lt;P&gt;Load&lt;BR /&gt;IDRegnKey,&lt;BR /&gt;count([Created date]) as CntCreateDt&lt;BR /&gt;Resident tbl&lt;BR /&gt;group by&lt;BR /&gt;IDRegnKey&lt;BR /&gt;;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 12:44:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827472#M68101</guid>
      <dc:creator>NageshSG</dc:creator>
      <dc:date>2021-08-09T12:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Flag creation</title>
      <link>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827476#M68103</link>
      <description>&lt;P&gt;Adding on.. just a word of caution!&lt;/P&gt;&lt;P&gt;When you aggregate on date fields containing date/time parts, better to use functions like floor or datestart to avoid unexpected results.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 13:05:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827476#M68103</guid>
      <dc:creator>NageshSG</dc:creator>
      <dc:date>2021-08-09T13:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Flag creation</title>
      <link>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827490#M68105</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/84516"&gt;@NageshSG&lt;/a&gt;&amp;nbsp;good point to add! thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 13:43:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Flag-creation/m-p/1827490#M68105</guid>
      <dc:creator>stevejoyce</dc:creator>
      <dc:date>2021-08-09T13:43:45Z</dc:date>
    </item>
  </channel>
</rss>

