<?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 Aggregate count on parent and child both in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggregate-count-on-parent-and-child-both/m-p/624733#M229797</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;I have a requirement where i need to count the number of FLAGs (Y or N) for Product and product line levels. One product can have multiple product lines and that one product can contain some product line as 'Y' and some as 'N'. But if my product has a single 'N' for any product line, then overall it would be 'N'. Please find below example for clear idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="WIDTH: 393px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="55"&gt;Product&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none;" width="94"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProductLine&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none;" width="137"&gt;&amp;nbsp;&amp;nbsp; FlagForProductLine&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none;" width="107"&gt;&amp;nbsp; FlagForProduct&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;A&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;A1&lt;/TD&gt;&lt;TD class="xl64" style="border-left: medium none; border-top: medium none;"&gt;Y&lt;/TD&gt;&lt;TD class="xl65" rowspan="3" style="border-top: medium none;"&gt;N&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;A&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;A2&lt;/TD&gt;&lt;TD class="xl64" style="border-left: medium none; border-top: medium none;"&gt;N&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;A&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;A3&lt;/TD&gt;&lt;TD class="xl64" style="border-left: medium none; border-top: medium none;"&gt;Y&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;B&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;B1&lt;/TD&gt;&lt;TD class="xl64" style="border-left: medium none; border-top: medium none;"&gt;Y&lt;/TD&gt;&lt;TD class="xl65" rowspan="2" style="border-top: medium none;"&gt;Y&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;B&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;B2&lt;/TD&gt;&lt;TD class="xl64" style="border-left: medium none; border-top: medium none;"&gt;Y&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;C&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;C1&lt;/TD&gt;&lt;TD class="xl64" style="border-left: medium none; border-top: medium none;"&gt;N&lt;/TD&gt;&lt;TD class="xl65" rowspan="2" style="border-top: medium none;"&gt;N&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;C&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;C2&lt;/TD&gt;&lt;TD class="xl64" style="border-left: medium none; border-top: medium none;"&gt;N&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have product,productline and FlagForProductLine information in my data. Data is at productline level in database.&lt;/P&gt;&lt;P&gt;Can anyone please help me in calculating FlagForProduct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Mar 2014 14:43:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-03-11T14:43:30Z</dc:date>
    <item>
      <title>Aggregate count on parent and child both</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-count-on-parent-and-child-both/m-p/624733#M229797</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;I have a requirement where i need to count the number of FLAGs (Y or N) for Product and product line levels. One product can have multiple product lines and that one product can contain some product line as 'Y' and some as 'N'. But if my product has a single 'N' for any product line, then overall it would be 'N'. Please find below example for clear idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="WIDTH: 393px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="55"&gt;Product&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none;" width="94"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProductLine&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none;" width="137"&gt;&amp;nbsp;&amp;nbsp; FlagForProductLine&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none;" width="107"&gt;&amp;nbsp; FlagForProduct&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;A&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;A1&lt;/TD&gt;&lt;TD class="xl64" style="border-left: medium none; border-top: medium none;"&gt;Y&lt;/TD&gt;&lt;TD class="xl65" rowspan="3" style="border-top: medium none;"&gt;N&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;A&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;A2&lt;/TD&gt;&lt;TD class="xl64" style="border-left: medium none; border-top: medium none;"&gt;N&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;A&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;A3&lt;/TD&gt;&lt;TD class="xl64" style="border-left: medium none; border-top: medium none;"&gt;Y&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;B&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;B1&lt;/TD&gt;&lt;TD class="xl64" style="border-left: medium none; border-top: medium none;"&gt;Y&lt;/TD&gt;&lt;TD class="xl65" rowspan="2" style="border-top: medium none;"&gt;Y&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;B&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;B2&lt;/TD&gt;&lt;TD class="xl64" style="border-left: medium none; border-top: medium none;"&gt;Y&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;C&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;C1&lt;/TD&gt;&lt;TD class="xl64" style="border-left: medium none; border-top: medium none;"&gt;N&lt;/TD&gt;&lt;TD class="xl65" rowspan="2" style="border-top: medium none;"&gt;N&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;C&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;C2&lt;/TD&gt;&lt;TD class="xl64" style="border-left: medium none; border-top: medium none;"&gt;N&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have product,productline and FlagForProductLine information in my data. Data is at productline level in database.&lt;/P&gt;&lt;P&gt;Can anyone please help me in calculating FlagForProduct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2014 14:43:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-count-on-parent-and-child-both/m-p/624733#M229797</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-11T14:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate count on parent and child both</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-count-on-parent-and-child-both/m-p/624734#M229798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Subhasmita,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in effect, you have to concatenate all your "status_letters", so you get sth. like NYYN or YYYN or whatever - and then you can use a string_function like INDEX() to find out if that string contains at least one 'N', in which case your overall "status" would be N.&lt;/P&gt;&lt;P&gt;=&amp;gt; On scripting level, you would have to use the PEEK() fct., to check whether the product is still the same as in the record immediately above and&lt;/P&gt;&lt;P&gt;- if that is the case, concatenate the status_letter to the construct you already have&lt;/P&gt;&lt;P&gt;- if not, just write this record's status_letter as a new field (start a new construct)&lt;/P&gt;&lt;P&gt;&amp;lt;=&amp;gt; You also have to allow for the very first record where the PEEK() function will not work as there is no record above. You can catch that using the Recno() function.&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2014 14:49:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-count-on-parent-and-child-both/m-p/624734#M229798</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2014-03-11T14:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate count on parent and child both</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-count-on-parent-and-child-both/m-p/624735#M229799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you be more specific in your requirements?&lt;/P&gt;&lt;P&gt;If possible, please explain with required result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2014 14:50:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-count-on-parent-and-child-both/m-p/624735#M229799</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-03-11T14:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate count on parent and child both</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-count-on-parent-and-child-both/m-p/624736#M229800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T1:&lt;/P&gt;&lt;P&gt;LOAD * Inline [&lt;/P&gt;&lt;P&gt;Product, ProductLine,FlagForProductLine&lt;/P&gt;&lt;P&gt;A, A1, Y&lt;/P&gt;&lt;P&gt;A, A2, N&lt;/P&gt;&lt;P&gt;A, A3, Y&lt;/P&gt;&lt;P&gt;B, B1, Y&lt;/P&gt;&lt;P&gt;B, B2, Y&lt;/P&gt;&lt;P&gt;C, C1, N&lt;/P&gt;&lt;P&gt;C, C2, N&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;Join&lt;/P&gt;&lt;P&gt;LOAD Product, If(SubStringCount(Concat(FlagForProductLine),'N')&amp;gt;0,'N','Y')&amp;nbsp; as FlagForProduct&amp;nbsp; Resident T1 Group By Product;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jagan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2014 14:55:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-count-on-parent-and-child-both/m-p/624736#M229800</guid>
      <dc:creator>jagannalla</dc:creator>
      <dc:date>2014-03-11T14:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate count on parent and child both</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-count-on-parent-and-child-both/m-p/624737#M229801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Jagan!&lt;/P&gt;&lt;P&gt;It worked how i wanted. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2014 15:04:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-count-on-parent-and-child-both/m-p/624737#M229801</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-11T15:04:38Z</dc:date>
    </item>
  </channel>
</rss>

