<?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: group by and first value not null in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/group-by-and-first-value-not-null/m-p/1849334#M70201</link>
    <description>&lt;P&gt;I didn't actually run the script, so that may be the case. Any function that returns a (string) value should work here, including FirstSortedValue, Only, and Mode.&lt;/P&gt;
&lt;P&gt;I actually ran it with Only and it works fine (I had to use if() statements to replace the blanks with actual nulls):&lt;/P&gt;
&lt;P&gt;Load [Num Employee], Only([Is he vegetarian]) as [Is he vegetarian], Only([Does he like chicken]) as [Does he like chicken]&lt;BR /&gt;Group by [Num Employee];&lt;BR /&gt;Load [Num Employee], if(len([Is he vegetarian])&amp;gt;0,[Is he vegetarian]) as [Is he vegetarian], if(len([Does he like chicken])&amp;gt;0,[Does he like chicken]) as [Does he like chicken]&lt;BR /&gt;INLINE [&lt;BR /&gt;Num Employee, Is he vegetarian, Does he like chicken&lt;BR /&gt;1, Yes, &lt;BR /&gt;1 , , Yes&lt;BR /&gt;2, Yes, &lt;BR /&gt;3, Yes, ] ;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Oct 2021 10:20:25 GMT</pubDate>
    <dc:creator>Or</dc:creator>
    <dc:date>2021-10-20T10:20:25Z</dc:date>
    <item>
      <title>group by and first value not null</title>
      <link>https://community.qlik.com/t5/App-Development/group-by-and-first-value-not-null/m-p/1849314#M70198</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have a little problem i wonder how to solve.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a table like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;Num Employee&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;Is he vegetarian&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;Does he like chicken&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;1&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;Yes&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;1&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;Yes&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;2&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;Yes&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;Yes&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And i would like to group by Employee&amp;nbsp; and have the values of the two other columns in the same row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;Num Employee&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;Is he vegetarian&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;Does he like chicken&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;1&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;Yes&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;Yes&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;2&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;Yes&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;3&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Yes&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried Firstvalue and firstsortedvalue distinct but using this I&amp;nbsp; have empty value at third column for the Employee 1 cause the first value of the third field is empty&amp;nbsp;&lt;/P&gt;
&lt;P&gt;( i need to do it in script )&lt;/P&gt;
&lt;P&gt;If i could have some indications / ideas&lt;/P&gt;
&lt;P&gt;thanks a lot for reading, have a nice day&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 09:46:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/group-by-and-first-value-not-null/m-p/1849314#M70198</guid>
      <dc:creator>flo2</dc:creator>
      <dc:date>2021-10-20T09:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: group by and first value not null</title>
      <link>https://community.qlik.com/t5/App-Development/group-by-and-first-value-not-null/m-p/1849326#M70199</link>
      <description>&lt;P&gt;Load [Num Employee], Max([Is he vegetarian]) as [Is he vegetarian], max([Does he like chicken]) as [Does he like chicken]&lt;/P&gt;
&lt;P&gt;Resident FirstTable&lt;/P&gt;
&lt;P&gt;Group by [Num Employee];&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 10:05:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/group-by-and-first-value-not-null/m-p/1849326#M70199</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-10-20T10:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: group by and first value not null</title>
      <link>https://community.qlik.com/t5/App-Development/group-by-and-first-value-not-null/m-p/1849331#M70200</link>
      <description>&lt;P&gt;Thanks for reply,&lt;/P&gt;
&lt;P&gt;But the result is a whole empty table&lt;/P&gt;
&lt;P&gt;is it not because max is just for numeric values ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;EDIT : I used maxString it seems ok, i would suit no ?&amp;nbsp;&lt;/STRONG&gt;&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>Wed, 20 Oct 2021 10:15:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/group-by-and-first-value-not-null/m-p/1849331#M70200</guid>
      <dc:creator>flo2</dc:creator>
      <dc:date>2021-10-20T10:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: group by and first value not null</title>
      <link>https://community.qlik.com/t5/App-Development/group-by-and-first-value-not-null/m-p/1849334#M70201</link>
      <description>&lt;P&gt;I didn't actually run the script, so that may be the case. Any function that returns a (string) value should work here, including FirstSortedValue, Only, and Mode.&lt;/P&gt;
&lt;P&gt;I actually ran it with Only and it works fine (I had to use if() statements to replace the blanks with actual nulls):&lt;/P&gt;
&lt;P&gt;Load [Num Employee], Only([Is he vegetarian]) as [Is he vegetarian], Only([Does he like chicken]) as [Does he like chicken]&lt;BR /&gt;Group by [Num Employee];&lt;BR /&gt;Load [Num Employee], if(len([Is he vegetarian])&amp;gt;0,[Is he vegetarian]) as [Is he vegetarian], if(len([Does he like chicken])&amp;gt;0,[Does he like chicken]) as [Does he like chicken]&lt;BR /&gt;INLINE [&lt;BR /&gt;Num Employee, Is he vegetarian, Does he like chicken&lt;BR /&gt;1, Yes, &lt;BR /&gt;1 , , Yes&lt;BR /&gt;2, Yes, &lt;BR /&gt;3, Yes, ] ;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 10:20:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/group-by-and-first-value-not-null/m-p/1849334#M70201</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-10-20T10:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: group by and first value not null</title>
      <link>https://community.qlik.com/t5/App-Development/group-by-and-first-value-not-null/m-p/1849755#M70237</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Another possible solution:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Temp:
NOCONCATENATE
LOAD *
INLINE [
        Num Employee, Is he vegetarian,	Does he like chicken
        1, Yes,	 
        1,,Yes
        2, Yes,	 
        3, Yes, 
];

Test:
NOCONCATENATE
LOAD [Num Employee], [Is he vegetarian]
RESIDENT Temp
WHERE Len([Is he vegetarian]) &amp;gt; 0
;

JOIN (Test)
LOAD [Num Employee], [Does he like chicken]
RESIDENT Temp
WHERE Len([Does he like chicken]) &amp;gt; 0
;

DROP TABLE Temp;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 20:28:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/group-by-and-first-value-not-null/m-p/1849755#M70237</guid>
      <dc:creator>JGMDataAnalysis</dc:creator>
      <dc:date>2021-10-20T20:28:26Z</dc:date>
    </item>
  </channel>
</rss>

