<?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: Count with Group-by function in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-with-Group-by-function-in-script/m-p/2042182#M1222773</link>
    <description>&lt;P&gt;What is your requirement / expected result?&amp;nbsp;&lt;BR /&gt;And I’m not sure what your second question is, could you clarify?&lt;/P&gt;</description>
    <pubDate>Sat, 25 Feb 2023 17:35:37 GMT</pubDate>
    <dc:creator>henrikalmen</dc:creator>
    <dc:date>2023-02-25T17:35:37Z</dc:date>
    <item>
      <title>Count with Group-by function in script</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-Group-by-function-in-script/m-p/2042174#M1222770</link>
      <description>&lt;P&gt;Hi Qlik community,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm new Qlik product I'm facing a issue any one helps&lt;/P&gt;
&lt;P&gt;I have a sample data which is attached picture here, i need to count with group-by, for this i wrote like this:&lt;/P&gt;
&lt;P&gt;Table1:&lt;/P&gt;
&lt;P&gt;Load Prod, Year &amp;amp; '-' &amp;amp; Month as KEY, Price; Load Prod, Year, Month, Price from Table1;&lt;/P&gt;
&lt;P&gt;Table2:&lt;/P&gt;
&lt;P&gt;Load Ord. No, Year &amp;amp; '-' &amp;amp; Month as KEY, Id; Load Ord. No, Year, Month, Id from Table2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result_Table:&lt;/P&gt;
&lt;P&gt;Load Id, Count (Id) as Count_Id Resident Table2&lt;/P&gt;
&lt;P&gt;Group By Id;&lt;/P&gt;
&lt;P&gt;But it's not met my requirement, what should i do to achieve expected result from script and where i'm wrong? and one more question, for this row -level set analysis will works, if yes, what is syntax?&lt;/P&gt;
&lt;P&gt;Any help wuold be appreciated.&lt;/P&gt;
&lt;P&gt;Thanks in advance.&amp;nbsp;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_20230225-184856_Teams.jpg" style="width: 1964px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/101377iC876472B4B4DD2BE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot_20230225-184856_Teams.jpg" alt="Screenshot_20230225-184856_Teams.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Feb 2023 13:55:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-Group-by-function-in-script/m-p/2042174#M1222770</guid>
      <dc:creator>MartinMCS</dc:creator>
      <dc:date>2023-02-25T13:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Count with Group-by function in script</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-Group-by-function-in-script/m-p/2042182#M1222773</link>
      <description>&lt;P&gt;What is your requirement / expected result?&amp;nbsp;&lt;BR /&gt;And I’m not sure what your second question is, could you clarify?&lt;/P&gt;</description>
      <pubDate>Sat, 25 Feb 2023 17:35:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-Group-by-function-in-script/m-p/2042182#M1222773</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2023-02-25T17:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Count with Group-by function in script</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-Group-by-function-in-script/m-p/2042201#M1222777</link>
      <description>&lt;P&gt;Hi, need to create a new table in script with columns of &lt;STRONG&gt;Couunt(Id) as Count_Id and Id.&lt;/STRONG&gt; If I select &lt;STRONG&gt;Prod is 'Y2021' the corresponding field Count_Id is should show '2'.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Second question is set analysis or expression works for this? If yes, how to write set expression to achieve Average in front-end.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Feb 2023 02:17:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-Group-by-function-in-script/m-p/2042201#M1222777</guid>
      <dc:creator>MartinMCS</dc:creator>
      <dc:date>2023-02-26T02:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Count with Group-by function in script</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-Group-by-function-in-script/m-p/2042209#M1222778</link>
      <description>&lt;P&gt;Load Id, Count (Id) as Count_Id Resident Table2&amp;nbsp;&lt;SPAN&gt;Group By Id;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That statement does what it should. It gives you a table with Id and the Count_Id as you want. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But those values are static. If you need it to show different values when doing selections in the Prod field, you probably need to create your table like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Load Id, Prod, Count (Id) as Count_Id Resident Table2&amp;nbsp;&lt;SPAN&gt;Group By Id, Prod;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;But maybe you shouldn’t create such a table in backend at all. Try creating a table chart with Id as dimension, and count(Id) as measure. You don’t need to use “group by” in frontend.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;I'm still not sure about your second question. Generally, if you want to calculate average you use the avg() function instead of sum().&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Feb 2023 07:00:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-Group-by-function-in-script/m-p/2042209#M1222778</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2023-02-26T07:00:33Z</dc:date>
    </item>
  </channel>
</rss>

