title: Create a graph with three values in which two of them depend on the maxium of the other
body: <p>I have a table with four columns:</p>
  <ul>
  <li>The date truncated to the minute</li>
  <li>The maximun number of concurrent calls of this minute</li>
  <li>For this calls, which are inbound calls</li>
  <li>For this calls, which are outbound calls</li>
  </ul>
  <p><a href="https://i.stack.imgur.com/MWIp7.png" rel="nofollow noreferrer">Table Example</a></p>
  <p>keep in mind that Max concurrent calls=inbound+outbound</p>
  <p>I want to plot on the same graph the maximum number of concurrent calls with their respective number of incoming and outgoing calls with an option to change the aggregation.</p>
  <p>The problem comes when I try to change the aggregation. Instead of having the maximun number of calls and their respective number of incoming and outgoing calls, I plot the maximun number of calls and the maximun number of outbound and inbound calls of this period.</p>
  <p>For instance, If we plot using the data of the example table, the datapoints that I expect are 4 max concurrent calss, 4 inbound calls and 0 outbound calls. However, I get 4 max concurrent calss, 4 inbound and 2 outbound, because the maximun number of outbound calls in this period of time is 2.</p>
  <p>So, How can I plot the inbound and outbound of the maximun number of calls? I cannot see the option to graph columns depending of the values of others, and I am not able to create new fields that resolve this problem</p>
  <p>Edit:</p>
  <p>This is the plot that I want:</p>
  <p><a href="https://i.stack.imgur.com/XCrBj.png" rel="nofollow noreferrer">Plot</a></p>
  <p>Im using the maximun for all <a href="https://i.stack.imgur.com/MTix1.png" rel="nofollow noreferrer">values</a>
  The light blue line is the maximun number of calls,the orange is the inbounds and the blue is the outbounds. The first one is the sum of inbounds and outbounds. However, if I change the granularity to hours:
  <a href="https://i.stack.imgur.com/Rrqr3.png" rel="nofollow noreferrer">Wrong Plot</a>
  Now the light blue light line is not the some of the others(13+26 is 39,not 38).To get the number of outbounds and inbounds calls when the total calls are maximun, Im trying something like this:</p>
  <pre><code>ifelse({Total calls}=max({Total calls}),{Inbound calls},0)
  </code></pre>
  <p>In order to get the inbounds calls when the total calls are maximun. However Im getting mismatched aggregation error.</p>