<?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: Table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Table/m-p/1592164#M738903</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;You'll have to do several data manipulations to achieve this. Take a look at this script:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;start_tab:
LOAD * Inline
[
Company,	Product, 	Condition Met
ABC,	Bancassurance,	0
ABC,	BOL,	1
ABC,	Card and Diners NIR,	0
ABC,	Cash Deposit,	1
ABC,	Cashman,	0
ABC,	Commercial Property Finance,	0
ABC,	Current Account,	1
ABC,	Debtors Finance,	0
ABC,	Investments,	1
ABC,	Lending,	0
ABC,	Merchant,	1
];


prod_array_tab:
LOAD Concat(DISTINCT chr(39)&amp;amp;Company&amp;amp;'|'&amp;amp;Product&amp;amp;'|'&amp;amp;[Condition Met]&amp;amp;chr(39),',') as prod_array Resident start_tab;

LET vProd_array = Peek('prod_array',0,'prod_array_tab');

FOR Each vTab in $(vProd_array)
LET vTab_target = SubField('$(vTab)', '|',2);
Left Join(start_tab)
LOAD Company, Product, if(SubField('$(vTab)', '|',3) = 0, 0, [Condition Met]) as '$(vTab_target)' Resident start_tab;
NEXT

DROP Table prod_array_tab;&lt;/LI-CODE&gt;&lt;P&gt;First of all you should get all values of Product field concatenated with companies and condition met.&lt;/P&gt;&lt;P&gt;After that FOR EACH will loop through possible Products and generate a table similar to the original table but with one additional condition - if we met zero in Condition Met field than all values of Condition Met should be equal zero.&lt;/P&gt;&lt;P&gt;Hope this solution wont hesitate you.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jun 2019 16:42:39 GMT</pubDate>
    <dc:creator>Sergey_Shuklin</dc:creator>
    <dc:date>2019-06-14T16:42:39Z</dc:date>
    <item>
      <title>Table</title>
      <link>https://community.qlik.com/t5/QlikView/Table/m-p/1591911#M738902</link>
      <description>&lt;P&gt;I need to replicate the attached table in qlikview&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Table/m-p/1591911#M738902</guid>
      <dc:creator>kalpanaramjee</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Table</title>
      <link>https://community.qlik.com/t5/QlikView/Table/m-p/1592164#M738903</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;You'll have to do several data manipulations to achieve this. Take a look at this script:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;start_tab:
LOAD * Inline
[
Company,	Product, 	Condition Met
ABC,	Bancassurance,	0
ABC,	BOL,	1
ABC,	Card and Diners NIR,	0
ABC,	Cash Deposit,	1
ABC,	Cashman,	0
ABC,	Commercial Property Finance,	0
ABC,	Current Account,	1
ABC,	Debtors Finance,	0
ABC,	Investments,	1
ABC,	Lending,	0
ABC,	Merchant,	1
];


prod_array_tab:
LOAD Concat(DISTINCT chr(39)&amp;amp;Company&amp;amp;'|'&amp;amp;Product&amp;amp;'|'&amp;amp;[Condition Met]&amp;amp;chr(39),',') as prod_array Resident start_tab;

LET vProd_array = Peek('prod_array',0,'prod_array_tab');

FOR Each vTab in $(vProd_array)
LET vTab_target = SubField('$(vTab)', '|',2);
Left Join(start_tab)
LOAD Company, Product, if(SubField('$(vTab)', '|',3) = 0, 0, [Condition Met]) as '$(vTab_target)' Resident start_tab;
NEXT

DROP Table prod_array_tab;&lt;/LI-CODE&gt;&lt;P&gt;First of all you should get all values of Product field concatenated with companies and condition met.&lt;/P&gt;&lt;P&gt;After that FOR EACH will loop through possible Products and generate a table similar to the original table but with one additional condition - if we met zero in Condition Met field than all values of Condition Met should be equal zero.&lt;/P&gt;&lt;P&gt;Hope this solution wont hesitate you.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2019 16:42:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Table/m-p/1592164#M738903</guid>
      <dc:creator>Sergey_Shuklin</dc:creator>
      <dc:date>2019-06-14T16:42:39Z</dc:date>
    </item>
  </channel>
</rss>

