<?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 Count Data In Different Coloumn in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-Data-In-Different-Coloumn/m-p/1687554#M455784</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you for your help and support first.&lt;/P&gt;&lt;P&gt;There are three columns in the table.&amp;nbsp; WO, Wo_Tree and WO_Parent.&lt;/P&gt;&lt;P&gt;What I want is for each WO, check if WO_Parent is equal to WO, if yes then Output will be OK.&lt;/P&gt;&lt;P&gt;If WO_Parent is not equal to WO, then count this&amp;nbsp;WO_Parent inside WO column.&lt;/P&gt;&lt;P&gt;If result &amp;gt;0, then Output will be DELETE ROW.&lt;/P&gt;&lt;P&gt;If result =0 that means WO_Parent is not in WO column,&amp;nbsp;then Output will be OK.&lt;/P&gt;&lt;P&gt;I am also sending the file that I add an example.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 18:53:19 GMT</pubDate>
    <dc:creator>smtgnc20</dc:creator>
    <dc:date>2024-11-16T18:53:19Z</dc:date>
    <item>
      <title>Count Data In Different Coloumn</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Data-In-Different-Coloumn/m-p/1687554#M455784</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you for your help and support first.&lt;/P&gt;&lt;P&gt;There are three columns in the table.&amp;nbsp; WO, Wo_Tree and WO_Parent.&lt;/P&gt;&lt;P&gt;What I want is for each WO, check if WO_Parent is equal to WO, if yes then Output will be OK.&lt;/P&gt;&lt;P&gt;If WO_Parent is not equal to WO, then count this&amp;nbsp;WO_Parent inside WO column.&lt;/P&gt;&lt;P&gt;If result &amp;gt;0, then Output will be DELETE ROW.&lt;/P&gt;&lt;P&gt;If result =0 that means WO_Parent is not in WO column,&amp;nbsp;then Output will be OK.&lt;/P&gt;&lt;P&gt;I am also sending the file that I add an example.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 18:53:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Data-In-Different-Coloumn/m-p/1687554#M455784</guid>
      <dc:creator>smtgnc20</dc:creator>
      <dc:date>2024-11-16T18:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: Count Data In Different Coloumn</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Data-In-Different-Coloumn/m-p/1687568#M455785</link>
      <description>&lt;P&gt;can you just confirm&lt;/P&gt;&lt;P&gt;if we take for example Line 2&lt;/P&gt;&lt;P&gt;B|A-B|A&lt;/P&gt;&lt;P&gt;Wo_parent&amp;lt;&amp;gt;WO and count this WO_Parent inside WO column=0 ===&amp;gt; Output will be 'OK'&lt;/P&gt;&lt;P&gt;So you write 'DELETE ROW' ?&lt;/P&gt;&lt;P&gt;and WO_Tree ?&lt;/P&gt;&lt;P&gt;can you just rewrite the post&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 09:18:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Data-In-Different-Coloumn/m-p/1687568#M455785</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-03-25T09:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Count Data In Different Coloumn</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Data-In-Different-Coloumn/m-p/1687699#M455786</link>
      <description>&lt;P&gt;Thank you for your prompt reply.&lt;/P&gt;&lt;P&gt;In table, WO_Tree is not important especially. It just shows the tree.&lt;/P&gt;&lt;P&gt;WO and WO_Parent columns are important.&lt;/P&gt;&lt;P&gt;For Line 2;&lt;/P&gt;&lt;P&gt;WO&amp;nbsp; &amp;nbsp; &amp;nbsp;WO_Tree&amp;nbsp; &amp;nbsp; &amp;nbsp;WO_Parent&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A-B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;&lt;P&gt;For this line 2, WO_Parent (A) is not equal to WO (B) and for&amp;nbsp;&lt;SPAN&gt;this&amp;nbsp;WO_Parent (A), there is one inside whole WO column. (WO column Line 1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then Output (Expression) will write "DELETE ROW"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 14:46:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Data-In-Different-Coloumn/m-p/1687699#M455786</guid>
      <dc:creator>smtgnc20</dc:creator>
      <dc:date>2020-03-25T14:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Count Data In Different Coloumn</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Data-In-Different-Coloumn/m-p/1687745#M455787</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;EM&gt;there is one inside whole WO column. (WO column Line 1)&lt;/EM&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;that's what I didn't understand.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 16:13:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Data-In-Different-Coloumn/m-p/1687745#M455787</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-03-25T16:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Count Data In Different Coloumn</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Data-In-Different-Coloumn/m-p/1687755#M455788</link>
      <description>&lt;P&gt;Think about table is like below.&lt;/P&gt;&lt;P&gt;WO&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WO_Parent&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Cost&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&amp;nbsp; &amp;nbsp;(5 for B and 5 for A)&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5&lt;/P&gt;&lt;P&gt;For WO = A, WO_Parent is also A, that means there is not any parent WO or sub WO for WO=A.&amp;nbsp; WO=A is not related with any WO.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For WO =B, parent WO is A,&amp;nbsp; This parent WO A is also exists in WO column, that means B is sub WO of A.&lt;/P&gt;&lt;P&gt;The purpose is to eliminate sub WO if the parent WO is in WO column of table because the cost of&amp;nbsp;sub WO exists within the cost of parent WO.&lt;/P&gt;&lt;P&gt;For clarification, the cost of B exists within the cost of A. So in order to avoid duplication, 2nd row for this example must be deleted.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 16:35:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Data-In-Different-Coloumn/m-p/1687755#M455788</guid>
      <dc:creator>smtgnc20</dc:creator>
      <dc:date>2020-03-25T16:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Count Data In Different Coloumn</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Data-In-Different-Coloumn/m-p/1687759#M455789</link>
      <description>&lt;P&gt;unless you means that the value WO_parent is already passed in the WO values&lt;/P&gt;&lt;P&gt;if that's it, I'll propose the following code:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Date:

LOAD * INLINE [
    WO, WO_Tree, WO_Parent
    A, A, A
    B, A-B, A
    C, A-B-C, B
    D, A-B-C-D, C
    E, E, E
    G, F-G, F
];


temp:
noconcatenate


load if(rowNo()=0,'-',peek(PrevW)&amp;amp;'-'&amp;amp;WO) as PrevW,* resident Date;

drop table Date;

Output:
noconcatenate
load *, 
if(trim(WO_Parent)=trim(WO),'OK',if(index(trim(PrevW),trim(WO_Parent))&amp;gt;0,'DELETE ROW','OK')) as Output

resident temp;

drop table temp;
drop field PrevW;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 617px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/30586iC209FD91B4F57026/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;attached Qlikview file&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 16:38:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Data-In-Different-Coloumn/m-p/1687759#M455789</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-03-25T16:38:09Z</dc:date>
    </item>
  </channel>
</rss>

