<?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 Show accumulated values in line chart, only until current hour in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Show-accumulated-values-in-line-chart-only-until-current-hour/m-p/2492138#M102144</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a line chart that shows sales values separated in time intervals. The values are accumulated, for which I've used the accumulation modifier. The dash updates every hour and the ideia is to display the sales values per hour, showing the total for each hour. It kinda works as expected, but it repeats the cumulation for every hour in the future. How can I avoid the repeated values?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="therealdees_0-1731356885244.png" style="width: 800px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/174199i7EF59FB3B144D408/image-dimensions/800x189?v=v2" width="800" height="189" role="button" title="therealdees_0-1731356885244.png" alt="therealdees_0-1731356885244.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The red line should display 86,67k only the first time. You can see it repeats the value for the future hours.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tried something like comparing the hour dimension with the current time saved in a variable, but weird things happen, I'm not sure what and why, but the idea was something like "if current time is &amp;lt; than time_dimension, display null(). I'm using continuous scale, because it's the only way I found to make the intervals work along with the sales timestamp, I'm not sure if that could be the problem...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the expression I'm currently using:&lt;BR /&gt;(&lt;BR /&gt;Sum({1&amp;lt;erp_hora_lancamento = {"&amp;lt;=$(=Time(MakeTime(Hour(Max({1&amp;lt;flag_venda_devolucao = {'V', 'D'}, erp_data_lancamento = {"$(=Date(Today(), 'YYYY-MM-DD'))"}&amp;gt;} erp_hora_lancamento)), 59, 59)))"}, erp_data_lancamento = {"$(=Date(Today(), 'YYYY-MM-DD'))"}, flag_venda_devolucao = {'V'}&amp;gt;} erp_valor_total)&lt;BR /&gt;-&lt;BR /&gt;Sum({1&amp;lt;erp_hora_lancamento = {"&amp;lt;=$(=Time(MakeTime(Hour(Max({1&amp;lt;flag_venda_devolucao = {'V', 'D'}, erp_data_lancamento = {"$(=Date(Today(), 'YYYY-MM-DD'))"}&amp;gt;} erp_hora_lancamento)), 59, 59)))"}, erp_data_lancamento = {"$(=Date(Today(), 'YYYY-MM-DD'))"}, flag_venda_devolucao = {'D'}&amp;gt;} erp_valor_total)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We analyse both sales and devolutions, that's the reason I subtract both.&lt;/P&gt;
&lt;P&gt;flag_venda_devolucao = flag to identity whether it's a sale or a devolution.&lt;/P&gt;
&lt;P&gt;erp_hora_lancamento = the sale timestamp&lt;/P&gt;
&lt;P&gt;Basically, I get the time for the latest sale/devolution to set the time scope in the expression. Not sure if it's the best expression, but it works without the cumulation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I display only 1 value for the latest hour, instead repeating the same value?&lt;/P&gt;</description>
    <pubDate>Mon, 11 Nov 2024 20:40:33 GMT</pubDate>
    <dc:creator>pedrohenriqueperna</dc:creator>
    <dc:date>2024-11-11T20:40:33Z</dc:date>
    <item>
      <title>Show accumulated values in line chart, only until current hour</title>
      <link>https://community.qlik.com/t5/App-Development/Show-accumulated-values-in-line-chart-only-until-current-hour/m-p/2492138#M102144</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a line chart that shows sales values separated in time intervals. The values are accumulated, for which I've used the accumulation modifier. The dash updates every hour and the ideia is to display the sales values per hour, showing the total for each hour. It kinda works as expected, but it repeats the cumulation for every hour in the future. How can I avoid the repeated values?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="therealdees_0-1731356885244.png" style="width: 800px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/174199i7EF59FB3B144D408/image-dimensions/800x189?v=v2" width="800" height="189" role="button" title="therealdees_0-1731356885244.png" alt="therealdees_0-1731356885244.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The red line should display 86,67k only the first time. You can see it repeats the value for the future hours.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tried something like comparing the hour dimension with the current time saved in a variable, but weird things happen, I'm not sure what and why, but the idea was something like "if current time is &amp;lt; than time_dimension, display null(). I'm using continuous scale, because it's the only way I found to make the intervals work along with the sales timestamp, I'm not sure if that could be the problem...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the expression I'm currently using:&lt;BR /&gt;(&lt;BR /&gt;Sum({1&amp;lt;erp_hora_lancamento = {"&amp;lt;=$(=Time(MakeTime(Hour(Max({1&amp;lt;flag_venda_devolucao = {'V', 'D'}, erp_data_lancamento = {"$(=Date(Today(), 'YYYY-MM-DD'))"}&amp;gt;} erp_hora_lancamento)), 59, 59)))"}, erp_data_lancamento = {"$(=Date(Today(), 'YYYY-MM-DD'))"}, flag_venda_devolucao = {'V'}&amp;gt;} erp_valor_total)&lt;BR /&gt;-&lt;BR /&gt;Sum({1&amp;lt;erp_hora_lancamento = {"&amp;lt;=$(=Time(MakeTime(Hour(Max({1&amp;lt;flag_venda_devolucao = {'V', 'D'}, erp_data_lancamento = {"$(=Date(Today(), 'YYYY-MM-DD'))"}&amp;gt;} erp_hora_lancamento)), 59, 59)))"}, erp_data_lancamento = {"$(=Date(Today(), 'YYYY-MM-DD'))"}, flag_venda_devolucao = {'D'}&amp;gt;} erp_valor_total)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We analyse both sales and devolutions, that's the reason I subtract both.&lt;/P&gt;
&lt;P&gt;flag_venda_devolucao = flag to identity whether it's a sale or a devolution.&lt;/P&gt;
&lt;P&gt;erp_hora_lancamento = the sale timestamp&lt;/P&gt;
&lt;P&gt;Basically, I get the time for the latest sale/devolution to set the time scope in the expression. Not sure if it's the best expression, but it works without the cumulation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I display only 1 value for the latest hour, instead repeating the same value?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2024 20:40:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-accumulated-values-in-line-chart-only-until-current-hour/m-p/2492138#M102144</guid>
      <dc:creator>pedrohenriqueperna</dc:creator>
      <dc:date>2024-11-11T20:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: Show accumulated values in line chart, only until current hour</title>
      <link>https://community.qlik.com/t5/App-Development/Show-accumulated-values-in-line-chart-only-until-current-hour/m-p/2492270#M102163</link>
      <description>&lt;P&gt;By using the default chart-settings your if-loop approach should be working but extra settings like the continuous scale or accumulation may overwrite the normal behaviour.&lt;/P&gt;
&lt;P&gt;An alternatively might be to disable those features and using interrecord-functions to get the accumulation, maybe something in this way:&lt;/P&gt;
&lt;P&gt;rangesum(above(YourExpression, 0, rowno(total))) * count(distinct Hour)&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 12:04:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-accumulated-values-in-line-chart-only-until-current-hour/m-p/2492270#M102163</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2024-11-12T12:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Show accumulated values in line chart, only until current hour</title>
      <link>https://community.qlik.com/t5/App-Development/Show-accumulated-values-in-line-chart-only-until-current-hour/m-p/2492368#M102180</link>
      <description>&lt;P&gt;Hi, Marcus&lt;/P&gt;
&lt;P&gt;I was tweaking around the additional options like continuous scale, but it turns out that the problem was something with the expression itself and how my dimensions are formatted. The following expression did the job:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;If(Hour(erp_hora_intervalo) &amp;lt;= '$(=Hour(vNow))' and Hour(erp_hora_intervalo) &amp;lt;&amp;gt; 0,&lt;BR /&gt;RangeSum(&lt;BR /&gt;Above( &lt;BR /&gt;(&lt;BR /&gt;(&lt;BR /&gt;Sum({&amp;lt;erp_hora_lancamento = {"&amp;lt;=$(=Time(Floor(TimeStamp#(vNow, 'mm/dd/yyyy h:mm:ss TT'), 1/24), 'hh:mm:ss'))"}, erp_data_lancamento = {"$(=Date(Today(), 'YYYY-MM-DD'))"}, flag_venda_devolucao = {'V'}&amp;gt;} erp_valor_total)&lt;BR /&gt;-&lt;BR /&gt;Sum({&amp;lt;erp_hora_lancamento = {"&amp;lt;=$(=Time(Floor(TimeStamp#(vNow, 'mm/dd/yyyy h:mm:ss TT'), 1/24), 'hh:mm:ss'))"}, erp_data_lancamento = {"$(=Date(Today(), 'YYYY-MM-DD'))"}, flag_venda_devolucao = {'D'}&amp;gt;} erp_valor_total)&lt;BR /&gt;)　&lt;/P&gt;
&lt;P&gt;), 0, RowNo(Total)))&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for helping.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 17:29:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-accumulated-values-in-line-chart-only-until-current-hour/m-p/2492368#M102180</guid>
      <dc:creator>pedrohenriqueperna</dc:creator>
      <dc:date>2024-11-12T17:29:33Z</dc:date>
    </item>
  </channel>
</rss>

