<?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: Aggr in Gantt chart returns wrong data for dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-in-Gantt-chart-returns-wrong-data-for-dates/m-p/1130718#M371712</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Exactly. Purchase on the 12th with a follow-up contact = red, purchase on the 13th without a contact = not red. The color itself is not that important, i know how to do that stuff as soon as the conditional works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 11:10:19 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-06-16T11:10:19Z</dc:date>
    <item>
      <title>Aggr in Gantt chart returns wrong data for dates</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-in-Gantt-chart-returns-wrong-data-for-dates/m-p/1130715#M371709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using a horizontal bar chart as a &lt;SPAN style="font-size: 13.3333px;"&gt;gantt chart (see &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2012/06/01/recipe-for-gantt-chart" style="font-size: 13.3333px;"&gt;here&lt;/A&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;) &lt;/SPAN&gt;where the first dimension is the user (only displays if only one user is selected) and the second one consists of the date, the time and the event (so every event will have their own bar). S&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;ee example dataset below, time in HHMMSS format, the expression is simply 1 (as one day).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14660741145267271" jivemacro_uid="_14660741145267271"&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; user, date, time, event&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Alice, 12.04.2016, 122036, Purchase&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Alice, 12.04.2016, 122500, Contact&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Alice, 13.04.2016, 163521, Purchase&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This creates three bars - one for the purchase on the 12th, one for the contact on the 12th and one for another Purchase on the 13th. I would like to color every bar (change background of expression) red that has a contact on the same day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried this formula which looks completely correct to me and i cant find any logical issues with it. It should create a virtual table where the expression is the number of contacts on one day per user and date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14660741954236647" jivemacro_uid="_14660741954236647"&gt;
&lt;P&gt;Aggr(SUM({$&amp;lt;event={'Contact'}&amp;gt;} 1), user, date)&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will return "1" for the "Contact" bar itself and null for every other bar, even the one on the same day. &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Using only "date" has the same result.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My wild guesses would be that the dimension (which includes the time) ruins the Aggr - function or that the virtual table has multiple rows and doesnt get matched to the date of the bar chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in Advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 10:54:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-in-Gantt-chart-returns-wrong-data-for-dates/m-p/1130715#M371709</guid>
      <dc:creator />
      <dc:date>2016-06-16T10:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr in Gantt chart returns wrong data for dates</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-in-Gantt-chart-returns-wrong-data-for-dates/m-p/1130716#M371710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;I would like to color every bar (change background of expression) red that has a contact on the same day.&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Contact on same day as what? Same day as Purchase&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 11:06:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-in-Gantt-chart-returns-wrong-data-for-dates/m-p/1130716#M371710</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-06-16T11:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr in Gantt chart returns wrong data for dates</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-in-Gantt-chart-returns-wrong-data-for-dates/m-p/1130717#M371711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-weight: inherit;"&gt;&lt;STRONG&gt;Max(TOTAL&amp;lt;user,date&amp;gt;&lt;/STRONG&gt; Aggr(SUM({$&amp;lt;event={'Contact'}&amp;gt;} 1), user, date) &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-weight: inherit;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-weight: inherit;"&gt;&lt;STRONG&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3779"&gt;Use Aggregation Functions!&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-weight: inherit;"&gt;Aggr(&lt;STRONG&gt;NODISTINCT&lt;/STRONG&gt; SUM({$&amp;lt;event={'Contact'}&amp;gt;} 1), user, date)&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-weight: inherit;"&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/4418"&gt;Pitfalls of the Aggr function&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 11:08:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-in-Gantt-chart-returns-wrong-data-for-dates/m-p/1130717#M371711</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-06-16T11:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr in Gantt chart returns wrong data for dates</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-in-Gantt-chart-returns-wrong-data-for-dates/m-p/1130718#M371712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Exactly. Purchase on the 12th with a follow-up contact = red, purchase on the 13th without a contact = not red. The color itself is not that important, i know how to do that stuff as soon as the conditional works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 11:10:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-in-Gantt-chart-returns-wrong-data-for-dates/m-p/1130718#M371712</guid>
      <dc:creator />
      <dc:date>2016-06-16T11:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr in Gantt chart returns wrong data for dates</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-in-Gantt-chart-returns-wrong-data-for-dates/m-p/1130719#M371713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answer! I did try the Max(TOTAL) aggregation already but it doesnt change anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adding the NODISTINCT magically worked for me though. Can you give an explaination why it didnt work before and why it works with nodistinct? Understanding the issue will surely benefit me in the future.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 11:15:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-in-Gantt-chart-returns-wrong-data-for-dates/m-p/1130719#M371713</guid>
      <dc:creator />
      <dc:date>2016-06-16T11:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr in Gantt chart returns wrong data for dates</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-in-Gantt-chart-returns-wrong-data-for-dates/m-p/1130720#M371714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's shortly explained in the second blog post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you are probably seeing is an issue called grain mismatch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are creating an virtual table based on dimensions user and date using the aggr() function, and then trying to project these table lines to an outer chart with more granular dimensions (i.e. also Time).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The aggr() function by default will produce only one result per user and date and thus only project this value once to a combination of user, date, time. All other times with same user, date will show a NULL.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 13:01:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-in-Gantt-chart-returns-wrong-data-for-dates/m-p/1130720#M371714</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-06-16T13:01:57Z</dc:date>
    </item>
  </channel>
</rss>

