<?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: Stacked Bar chart and offset in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Stacked-Bar-chart-and-offset/m-p/784579#M1035243</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;another solution could be to create calculated dimensions for date and time parts of the start timestamp and an expression for the bar offsets like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="_jivemacro_uid_14211942305488093 jive_text_macro jive_macro_code" jivemacro_uid="_14211942305488093"&gt;
&lt;P&gt;=RangeSum(Frac(Start),-Above(Frac(Start))-Above(Duration))&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that calculates the start position of each stacked bar segment.&lt;/P&gt;&lt;P&gt;rangesum() is used because Frac(Start)-Above(Frac(Start))-Above(Duration) would not deliver a value for the first segment of each bar (no above row present). Above() returns the value of the table row before ("above") the current row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="75241" alt="QlikCommunity_Thread_148292_Pic1.JPG" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/75241_QlikCommunity_Thread_148292_Pic1.JPG" style="height: 336px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="75245" alt="QlikCommunity_Thread_148292_Pic2.JPG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/75245_QlikCommunity_Thread_148292_Pic2.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="75246" alt="QlikCommunity_Thread_148292_Pic3.JPG" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/75246_QlikCommunity_Thread_148292_Pic3.JPG" style="height: 221px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="75247" alt="QlikCommunity_Thread_148292_Pic4.JPG" class="jive-image image-4" src="https://community.qlik.com/legacyfs/online/75247_QlikCommunity_Thread_148292_Pic4.JPG" style="height: 335px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Jan 2015 00:11:39 GMT</pubDate>
    <dc:creator>MarcoWedel</dc:creator>
    <dc:date>2015-01-14T00:11:39Z</dc:date>
    <item>
      <title>Stacked Bar chart and offset</title>
      <link>https://community.qlik.com/t5/QlikView/Stacked-Bar-chart-and-offset/m-p/784578#M1035242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to created a stacked bar chart using data that captures activity over a day. My raw data has a start time and a duration. I want to stack these in a single column but offset each section so that it starts on the start date and is the size of the duration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;IMG alt="Picture1.jpg" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/75240_Picture1.jpg" style="width: 620px; height: 393px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that I am close but my offset formula is using the "above" expression that I don't 100% understand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;min&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Tasks.DateAssigned&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)-&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;floor&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Min&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Tasks.DateAssigned&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))-&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;below&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;min&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Tasks.DateAssigned&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)-&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;floor&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Min&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Tasks.DateAssigned&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Thank you for your help&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 17:53:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Stacked-Bar-chart-and-offset/m-p/784578#M1035242</guid>
      <dc:creator />
      <dc:date>2015-01-13T17:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked Bar chart and offset</title>
      <link>https://community.qlik.com/t5/QlikView/Stacked-Bar-chart-and-offset/m-p/784579#M1035243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;another solution could be to create calculated dimensions for date and time parts of the start timestamp and an expression for the bar offsets like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="_jivemacro_uid_14211942305488093 jive_text_macro jive_macro_code" jivemacro_uid="_14211942305488093"&gt;
&lt;P&gt;=RangeSum(Frac(Start),-Above(Frac(Start))-Above(Duration))&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that calculates the start position of each stacked bar segment.&lt;/P&gt;&lt;P&gt;rangesum() is used because Frac(Start)-Above(Frac(Start))-Above(Duration) would not deliver a value for the first segment of each bar (no above row present). Above() returns the value of the table row before ("above") the current row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="75241" alt="QlikCommunity_Thread_148292_Pic1.JPG" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/75241_QlikCommunity_Thread_148292_Pic1.JPG" style="height: 336px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="75245" alt="QlikCommunity_Thread_148292_Pic2.JPG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/75245_QlikCommunity_Thread_148292_Pic2.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="75246" alt="QlikCommunity_Thread_148292_Pic3.JPG" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/75246_QlikCommunity_Thread_148292_Pic3.JPG" style="height: 221px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="75247" alt="QlikCommunity_Thread_148292_Pic4.JPG" class="jive-image image-4" src="https://community.qlik.com/legacyfs/online/75247_QlikCommunity_Thread_148292_Pic4.JPG" style="height: 335px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 00:11:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Stacked-Bar-chart-and-offset/m-p/784579#M1035243</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2015-01-14T00:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked Bar chart and offset</title>
      <link>https://community.qlik.com/t5/QlikView/Stacked-Bar-chart-and-offset/m-p/784580#M1035244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is so close to exactly what I need. I only have one issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I want to apply min and max times so that the graph only shows a working day but when I apply these in axis it doesn't appear to work for the minimum?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I don't suppose you could provide a brief explanation of how it works so that I might be able to understand things better and trouble shoot if any issues come up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 11:17:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Stacked-Bar-chart-and-offset/m-p/784580#M1035244</guid>
      <dc:creator />
      <dc:date>2015-01-14T11:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked Bar chart and offset</title>
      <link>https://community.qlik.com/t5/QlikView/Stacked-Bar-chart-and-offset/m-p/784581#M1035245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_148292_Pic6.JPG" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/75341_QlikCommunity_Thread_148292_Pic6.JPG" style="height: 337px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;did you deselect the "forced 0" check box?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_148292_Pic5.JPG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/75342_QlikCommunity_Thread_148292_Pic5.JPG" style="height: 550px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I have only start timestamps and durations in the datamodel, I used&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14212751563885689" jivemacro_uid="_14212751563885689"&gt;
&lt;P&gt;DayName(Start)&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;as first calculated dimension to extract the date part from the timestamp. DayName rounds of the decimal timestamp value of the start field to full dates and formats the resulting integer as date.&lt;/P&gt;&lt;P&gt;I then added&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14212752105192010" jivemacro_uid="_14212752105192010"&gt;
&lt;P&gt;Time(Frac(Start))&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;as secondary calculated dimension. Frac(Start) extracts the fractional part (containing the time value) of the decimal timestamp value.&lt;/P&gt;&lt;P&gt;Time() formats the resulting number (between 0 and 1) as time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since my test data only has one duration for each start timestamp, I just used "Duration" as the only expression.&lt;/P&gt;&lt;P&gt;The bar offset expression (under the dutration expression) defines an offset for each bar as&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14212755986576580" jivemacro_uid="_14212755986576580"&gt;
&lt;P&gt;=RangeSum(Frac(Start),-Above(Frac(Start))-Above(Duration))&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;which means that one bar starts at a time after the previous bar ends that is defined by "starttime-(starttime+duration of the previous bar)"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this makes sense and helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 22:51:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Stacked-Bar-chart-and-offset/m-p/784581#M1035245</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2015-01-14T22:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked Bar chart and offset</title>
      <link>https://community.qlik.com/t5/QlikView/Stacked-Bar-chart-and-offset/m-p/784582#M1035246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is brilliant - I am still having a some slight issues with my graph, I think it is because my data is very complex so I am using aggr and mins to get my durations and start times - the graph is plotting quite closely to correct figures but is slightly out. Can you spot anything that is incorrect?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Duration Expression&lt;/P&gt;&lt;P&gt;&lt;IMG alt="duration.jpg" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/75525_duration.jpg" style="width: 620px; height: 389px;" /&gt;&lt;BR /&gt;Offset Expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="bar offset.jpg" class="jive-image image-2" src="/legacyfs/online/75526_bar offset.jpg" style="width: 620px; height: 252px;" /&gt;&lt;/P&gt;&lt;P&gt;The reason for the min and aggr is due to multiple lines for each "Job"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for all your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Drew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 16:23:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Stacked-Bar-chart-and-offset/m-p/784582#M1035246</guid>
      <dc:creator />
      <dc:date>2015-01-16T16:23:52Z</dc:date>
    </item>
  </channel>
</rss>

