<?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: Trouble with complex formula in a graph in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Trouble-with-complex-formula-in-a-graph/m-p/873830#M996661</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about adding &lt;STRONG style="font-size: 13.3333330154419px;"&gt;&lt;EM&gt;Task&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; &lt;/SPAN&gt;to your Aggr() 's.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Task ='T1',&lt;/P&gt;&lt;P&gt;round(sum(if(aggr(sum( T1* proporcion), id_user, &lt;STRONG&gt;&lt;EM&gt;Task&lt;/EM&gt;&lt;/STRONG&gt; )&amp;gt;=1, 1)) //los que suman más de 1 se quedan a 1&lt;/P&gt;&lt;P&gt;+ sum(if(aggr(sum( T1* proporcion), id_user, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;&lt;EM&gt;Task&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; &lt;/SPAN&gt;)&amp;lt;1, //los que suman menos de 1 a lo que suman&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr(sum( T1* proporcion), id_user )))),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if(Task='T2',&lt;/P&gt;&lt;P&gt;round(sum(if(aggr(sum( T2* proporcion), id_user, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;&lt;EM&gt;Task&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; &lt;/SPAN&gt;)&amp;gt;=1, 1)) //los que suman más de 1 se quedan a 1&lt;/P&gt;&lt;P&gt;+ sum(if(aggr(sum( T2* proporcion), id_user, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;&lt;EM&gt;Task&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; &lt;/SPAN&gt;)&amp;lt;1, //los que suman menos de 1 a lo que suman&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr(sum( T2* proporcion), id_user )))),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Task='T3', sum(T3),&lt;/P&gt;&lt;P&gt;if(Task='T4', sum(T4),&lt;/P&gt;&lt;P&gt;))))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Jun 2015 14:25:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-06-22T14:25:19Z</dc:date>
    <item>
      <title>Trouble with complex formula in a graph</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-complex-formula-in-a-graph/m-p/873829#M996660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone:&lt;/P&gt;&lt;P&gt;I'm having some trouble when putting a complex formula in a graph.&lt;/P&gt;&lt;P&gt;We have several programs and different types of users who can collaborate on them.&lt;/P&gt;&lt;P&gt;Users of type 1 can collaborate on several programs and can make it partially according to a proportion of time. They only collaborate in tasks 1 and 2.&lt;/P&gt;&lt;P&gt;Users type 2 can collaborate on only one program and make it full time (proportion=1). They only collaborate on task 3 and 4.&lt;/P&gt;&lt;P&gt;We want know how many users we have available for each task in such a way that if one user of type 1 or 2 sums more than 1 (sum of programs he/she can work in * proportion ) it counts like 1. &lt;/P&gt;&lt;P&gt;I am using this formula for users of type 1 (counting users for task1):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;round(sum(if(aggr(sum( T1* proporcion), id_user )&amp;gt;=1, 1)) //greater than 1 counts 1&lt;/P&gt;&lt;P&gt;+ sum(if(aggr(sum( T1* proporcion), id_user )&amp;lt;1, //others what they sum&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr(sum( T1* proporcion), id_user ))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it seems to work. But when I try to make a graph with a nested if it doesn't work properly. The fist expession of the nested if is ok, but the second (counting users for task2 ) is set to 0. &lt;/P&gt;&lt;P&gt;I attach an example. If you select task2 in the value list it shows the graph ok.&lt;/P&gt;&lt;P&gt;What is wrong? Can any body help me?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: I have tried to load task 2 first in the inline table and it is the value that is shown. It seems to show the first value loaded.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 14:18:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-complex-formula-in-a-graph/m-p/873829#M996660</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-22T14:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with complex formula in a graph</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-complex-formula-in-a-graph/m-p/873830#M996661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about adding &lt;STRONG style="font-size: 13.3333330154419px;"&gt;&lt;EM&gt;Task&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; &lt;/SPAN&gt;to your Aggr() 's.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Task ='T1',&lt;/P&gt;&lt;P&gt;round(sum(if(aggr(sum( T1* proporcion), id_user, &lt;STRONG&gt;&lt;EM&gt;Task&lt;/EM&gt;&lt;/STRONG&gt; )&amp;gt;=1, 1)) //los que suman más de 1 se quedan a 1&lt;/P&gt;&lt;P&gt;+ sum(if(aggr(sum( T1* proporcion), id_user, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;&lt;EM&gt;Task&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; &lt;/SPAN&gt;)&amp;lt;1, //los que suman menos de 1 a lo que suman&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr(sum( T1* proporcion), id_user )))),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if(Task='T2',&lt;/P&gt;&lt;P&gt;round(sum(if(aggr(sum( T2* proporcion), id_user, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;&lt;EM&gt;Task&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; &lt;/SPAN&gt;)&amp;gt;=1, 1)) //los que suman más de 1 se quedan a 1&lt;/P&gt;&lt;P&gt;+ sum(if(aggr(sum( T2* proporcion), id_user, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;&lt;EM&gt;Task&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; &lt;/SPAN&gt;)&amp;lt;1, //los que suman menos de 1 a lo que suman&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr(sum( T2* proporcion), id_user )))),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Task='T3', sum(T3),&lt;/P&gt;&lt;P&gt;if(Task='T4', sum(T4),&lt;/P&gt;&lt;P&gt;))))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 14:25:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-complex-formula-in-a-graph/m-p/873830#M996661</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-22T14:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with complex formula in a graph</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-complex-formula-in-a-graph/m-p/873831#M996662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, It works!!!&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 15:35:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-complex-formula-in-a-graph/m-p/873831#M996662</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-22T15:35:25Z</dc:date>
    </item>
  </channel>
</rss>

