<?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: % calculation on yes/no fields in the load script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/calculation-on-yes-no-fields-in-the-load-script/m-p/1821586#M67359</link>
    <description>&lt;P&gt;I have another question about the transpose table. I want to load it without affecting the main table. it is working but the problem is it's transposing the data elements associated with the main table. How can I load it separately?&lt;/P&gt;&lt;P&gt;I loaded all the fields that are present in the main table (Table1) in a separate table (Table2) with NOConcatenate Load&amp;nbsp;then applied the Crosstable function with Resident (Table1) and drop table&amp;nbsp; (Table1)&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Jul 2021 02:18:45 GMT</pubDate>
    <dc:creator>dia2021</dc:creator>
    <dc:date>2021-07-13T02:18:45Z</dc:date>
    <item>
      <title>% calculation on yes/no fields in the load script</title>
      <link>https://community.qlik.com/t5/App-Development/calculation-on-yes-no-fields-in-the-load-script/m-p/1821173#M67314</link>
      <description>&lt;P&gt;I am trying to get the desired result based on yes/no fields in the load script.&amp;nbsp;&lt;SPAN&gt;I want to capture the aggregated percentage for the summary view based on all&amp;nbsp; 'yes' columns data elements.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Please see attached file with the data end result. I need to create two tables, one with the summary view and another with a detailed view.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help as soon as possible. I really appreciate any help you can provide.&lt;/P&gt;&lt;P&gt;Here is the script that I have created, but it's not working at the detailed level view. I need to create a pivot table with indent rows where numbers are repeating at the 2nd dimension drill.&amp;nbsp;&lt;/P&gt;&lt;P&gt;[Table]:&lt;BR /&gt;LOAD&lt;BR /&gt;[Order],&lt;BR /&gt;[Product],&lt;BR /&gt;[Metric],&lt;BR /&gt;[D],&lt;BR /&gt;[E],&lt;BR /&gt;[F],&lt;BR /&gt;[G,&lt;BR /&gt;[H],&lt;BR /&gt;[I],&lt;BR /&gt;[J],&lt;BR /&gt;[K],&lt;BR /&gt;[L],&lt;BR /&gt;&lt;BR /&gt;FROM .....&lt;/P&gt;&lt;P&gt;NoConcatenate LOAD&lt;BR /&gt;"Order","Product", Count(DISTINCT Metric) as "# of Metrics"&lt;BR /&gt;Resident [Table] Group By "Order","Product";&lt;/P&gt;&lt;P&gt;Calc:&lt;BR /&gt;Load&lt;BR /&gt;"Order",&lt;BR /&gt;count(if(match([D],'Yes'),[D]))&lt;BR /&gt;+ count(if(match([E],'Yes'),[E]))&lt;BR /&gt;+ count(if(match([F],'Yes'),[F))&lt;BR /&gt;+ count(if(match([G],'Yes'),[G]))&lt;BR /&gt;+ count(if(match([H],'Yes'),[H]))&lt;BR /&gt;+ count(if(match([I],'Yes'),[I]))&lt;BR /&gt;+ count(if(match([J],'Yes'),[J]))&lt;BR /&gt;+ count(if(match([K],'Yes'),[K]))&lt;BR /&gt;+ count(if(match([L],'Yes'),[L])) As MDefYes,&lt;BR /&gt;&lt;BR /&gt;count([D])&lt;BR /&gt;+Count([E])&lt;BR /&gt;+Count([F])&lt;BR /&gt;+Count([G])&lt;BR /&gt;+Count([H])&lt;BR /&gt;+Count([I])&lt;BR /&gt;+Count([J])&lt;BR /&gt;+Count([K)&lt;BR /&gt;+Count([L]) As MDefTotal&lt;BR /&gt;&lt;BR /&gt;FROM where order = 'ID1'&lt;BR /&gt;Group By "Order";&lt;/P&gt;&lt;P&gt;Test:&lt;BR /&gt;Join Load "Order",&lt;BR /&gt;num((Sum(MDefTotal)/Sum(MDefYes))/100, '#,##0.00%' ) As R3Avg&lt;BR /&gt;RESIDENT Calc Group By "Order";&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 18:17:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/calculation-on-yes-no-fields-in-the-load-script/m-p/1821173#M67314</guid>
      <dc:creator>dia2021</dc:creator>
      <dc:date>2021-11-30T18:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: % calculation on yes/no fields in the load script</title>
      <link>https://community.qlik.com/t5/App-Development/calculation-on-yes-no-fields-in-the-load-script/m-p/1821174#M67315</link>
      <description>&lt;P&gt;Hi I don't know wich table you call the 'Detail ' table but I see some errors and some typos in your code.&lt;/P&gt;&lt;P&gt;- You are checking Yes and the excel stores yes (without the initial uppercase)&lt;/P&gt;&lt;P&gt;-&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;count(if(match([F],'Yes'),[F)) -&amp;gt;&amp;nbsp;&amp;nbsp;count(if(match([F],'Yes'),[F&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;/FONT&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-&amp;nbsp;+Count([K) -&amp;gt;&amp;nbsp;+Count([K&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;/FONT&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-&amp;nbsp;FROM where order = 'ID1' -&amp;gt; Resident Table (without the Where)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-&amp;nbsp;Sum(MDefTotal)/Sum(MDefYes) -&amp;gt;&amp;nbsp;Sum(MDefYes)/Sum(MDefTotal)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you need the values by product just add another table that groups buy product or by order and product.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I fyou found another issue post the value you get and the expected result.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jul 2021 06:54:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/calculation-on-yes-no-fields-in-the-load-script/m-p/1821174#M67315</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2021-07-10T06:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: % calculation on yes/no fields in the load script</title>
      <link>https://community.qlik.com/t5/App-Development/calculation-on-yes-no-fields-in-the-load-script/m-p/1821199#M67317</link>
      <description>&lt;P&gt;Hi Rubernmarin, Thanks for your reply!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply Rubernmarin!&lt;/P&gt;&lt;P&gt;I have not added the Detail level table in the script. I will add and check the numbers by product. Also, make changes to the script as you suggested above.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry, - 'Yes' is in the initial uppercase in the real dataset. (I just created this file in a rush), but thanks for catching up.&amp;nbsp;I tried creating the&amp;nbsp;&lt;SPAN&gt;values by-product in another table that groups by order and product, it results in creating a synthetic key.&amp;nbsp; It's not taking group by syntax with both fields together.&amp;nbsp; I also tried the concatenate load after the load statement to solve the synthetic keys without any luck. Any idea?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a question can it be done through the loop statement because it is a huge dataset?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jul 2021 12:49:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/calculation-on-yes-no-fields-in-the-load-script/m-p/1821199#M67317</guid>
      <dc:creator>dia2021</dc:creator>
      <dc:date>2021-07-10T12:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: % calculation on yes/no fields in the load script</title>
      <link>https://community.qlik.com/t5/App-Development/calculation-on-yes-no-fields-in-the-load-script/m-p/1821205#M67318</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;SPAN&gt;Rubernmarin!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It worked!! Thanks a lot!!&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I created another table with the group by Product only and fixed the things you mentioned above.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can I achieve this with the loop statement? Which would be the best option to implement this?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jul 2021 14:06:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/calculation-on-yes-no-fields-in-the-load-script/m-p/1821205#M67318</guid>
      <dc:creator>dia2021</dc:creator>
      <dc:date>2021-07-10T14:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: % calculation on yes/no fields in the load script</title>
      <link>https://community.qlik.com/t5/App-Development/calculation-on-yes-no-fields-in-the-load-script/m-p/1821217#M67322</link>
      <description>&lt;P&gt;Hi, the synthetc key is between the original tabla and the grouped one? You can create a composite key to avoid it.&lt;/P&gt;&lt;P&gt;LOAD Order&amp;amp;'_'&amp;amp;Product as IdOrderProduct,&lt;/P&gt;&lt;P&gt;This composite key has to be loaded in both table to relate data, but Order and Product fields should be in only one table.&lt;/P&gt;&lt;P&gt;Why you want a loop? Usually a loop is slower than process all data.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jul 2021 17:47:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/calculation-on-yes-no-fields-in-the-load-script/m-p/1821217#M67322</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2021-07-10T17:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: % calculation on yes/no fields in the load script</title>
      <link>https://community.qlik.com/t5/App-Development/calculation-on-yes-no-fields-in-the-load-script/m-p/1821586#M67359</link>
      <description>&lt;P&gt;I have another question about the transpose table. I want to load it without affecting the main table. it is working but the problem is it's transposing the data elements associated with the main table. How can I load it separately?&lt;/P&gt;&lt;P&gt;I loaded all the fields that are present in the main table (Table1) in a separate table (Table2) with NOConcatenate Load&amp;nbsp;then applied the Crosstable function with Resident (Table1) and drop table&amp;nbsp; (Table1)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 02:18:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/calculation-on-yes-no-fields-in-the-load-script/m-p/1821586#M67359</guid>
      <dc:creator>dia2021</dc:creator>
      <dc:date>2021-07-13T02:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: % calculation on yes/no fields in the load script</title>
      <link>https://community.qlik.com/t5/App-Development/calculation-on-yes-no-fields-in-the-load-script/m-p/1824057#M67621</link>
      <description>&lt;P&gt;Hi, I missed this last question, is still an issue? I don't fully understand.. can you write why are you trying to do adding some little sample data to help to undertand it?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 06:04:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/calculation-on-yes-no-fields-in-the-load-script/m-p/1824057#M67621</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2021-07-23T06:04:53Z</dc:date>
    </item>
  </channel>
</rss>

