<?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: Before function in Qlik Sense Saas and null  values in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Before-function-in-Qlik-Sense-Saas-and-null-values/m-p/2523020#M106726</link>
    <description>&lt;P&gt;Of course I already tried, it doesn't work.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Jul 2025 17:59:08 GMT</pubDate>
    <dc:creator>mike_spada</dc:creator>
    <dc:date>2025-07-02T17:59:08Z</dc:date>
    <item>
      <title>Before function in Qlik Sense Saas and null  values</title>
      <link>https://community.qlik.com/t5/App-Development/Before-function-in-Qlik-Sense-Saas-and-null-values/m-p/2523000#M106722</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I hope someone can help me with a problem that's driving me crazy.&lt;/P&gt;&lt;P&gt;I migrated an application from QV to Sense Saas, I have a pivot with Customer as dimension, Year on pivot column and Amount. I want simply calculate the difference between years.&lt;/P&gt;&lt;P&gt;I created a table with this expression for Amout: Sum(Amount). In QlikView I had, for the difference, a column under every year with Sum(Amount)-Before(Sum(Amount)). In Sense it works until I have amounts for both years (for ex: 2024 and 2025), but if one of this is null (because there is no value in the entity loaded for that customer - year) it doesn't work and it doesn't calculate the difference.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column Year is sorted, Customer's too.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone has some idea to face this issue?&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;M.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2025 13:20:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Before-function-in-Qlik-Sense-Saas-and-null-values/m-p/2523000#M106722</guid>
      <dc:creator>mike_spada</dc:creator>
      <dc:date>2025-07-02T13:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Before function in Qlik Sense Saas and null  values</title>
      <link>https://community.qlik.com/t5/App-Development/Before-function-in-Qlik-Sense-Saas-and-null-values/m-p/2523001#M106723</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Write in the measure that if the value isnull then return 0 using the if and isnull function.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2025 13:36:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Before-function-in-Qlik-Sense-Saas-and-null-values/m-p/2523001#M106723</guid>
      <dc:creator>seanbruton</dc:creator>
      <dc:date>2025-07-02T13:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Before function in Qlik Sense Saas and null  values</title>
      <link>https://community.qlik.com/t5/App-Development/Before-function-in-Qlik-Sense-Saas-and-null-values/m-p/2523020#M106726</link>
      <description>&lt;P&gt;Of course I already tried, it doesn't work.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2025 17:59:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Before-function-in-Qlik-Sense-Saas-and-null-values/m-p/2523020#M106726</guid>
      <dc:creator>mike_spada</dc:creator>
      <dc:date>2025-07-02T17:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Before function in Qlik Sense Saas and null  values</title>
      <link>https://community.qlik.com/t5/App-Development/Before-function-in-Qlik-Sense-Saas-and-null-values/m-p/2523359#M106784</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="0" data-end="281"&gt;This issue with the &lt;CODE data-start="20" data-end="30"&gt;Before()&lt;/CODE&gt; function in Qlik Sense SaaS often happens due to how it handles &lt;STRONG data-start="95" data-end="110"&gt;null values&lt;/STRONG&gt; differently from QlikView. When one of the years has no data (i.e., is null), &lt;CODE data-start="189" data-end="210"&gt;Before(Sum(Amount))&lt;/CODE&gt; returns null too—so the subtraction results in &lt;STRONG data-start="258" data-end="266"&gt;null&lt;/STRONG&gt;, not a number.&lt;/P&gt;
&lt;P data-start="283" data-end="430"&gt;To fix this, you can use the &lt;CODE data-start="312" data-end="324"&gt;RangeSum()&lt;/CODE&gt; function with &lt;CODE data-start="339" data-end="346"&gt;Alt()&lt;/CODE&gt; or &lt;CODE data-start="350" data-end="367"&gt;If(IsNull(...))&lt;/CODE&gt; logic to handle nulls explicitly. Try this revised expression:&lt;/P&gt;
&lt;P&gt;RangeSum(Sum(Amount), -Alt(Before(Sum(Amount)), 0))&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P data-start="497" data-end="631"&gt;This ensures that if the previous year’s amount is null, it will be treated as &lt;CODE data-start="576" data-end="579"&gt;0&lt;/CODE&gt;, allowing the difference to be calculated properly.&lt;/P&gt;
&lt;P data-start="633" data-end="956"&gt;For more on handling expressions in SaaS apps, especially useful for industries like &lt;A href="https://estateagentsilford.co.uk/facilities-management-services/" target="_self"&gt;facilities management&lt;/A&gt; that rely on year-over-year comparisons, check Qlik’s official &lt;A class="cursor-pointer" target="_new" rel="noopener" data-start="807" data-end="955"&gt;expression documentation&lt;/A&gt;.&lt;/P&gt;
&lt;P data-start="958" data-end="1025" data-is-last-node="" data-is-only-node=""&gt;Let me know if you'd like help applying this to a full table setup!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jul 2025 09:14:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Before-function-in-Qlik-Sense-Saas-and-null-values/m-p/2523359#M106784</guid>
      <dc:creator>Kearawill</dc:creator>
      <dc:date>2025-07-08T09:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: Before function in Qlik Sense Saas and null  values</title>
      <link>https://community.qlik.com/t5/App-Development/Before-function-in-Qlik-Sense-Saas-and-null-values/m-p/2537384#M108808</link>
      <description>&lt;P&gt;The Before() function in Qlik Sense SaaS treats null values differently than QlikView. When yearly data is missing, Before(Sum(Amount)) returns null, making your difference calculation fail.&lt;/P&gt;
&lt;P&gt;Fix: Replace your expression with:&lt;/P&gt;
&lt;P data-unlink="true"&gt;qlik&lt;BR /&gt;RangeSum(Sum(Amount), -Alt(Before(Sum(Amount)), 0))&lt;BR /&gt;This converts null values to zero before calculation,&amp;nbsp;&lt;SPAN data-sheets-root="1"&gt;metal buildings wisconsin&lt;/SPAN&gt;&amp;nbsp; ensuring proper year-over-year comparisons even with missing data.&lt;/P&gt;
&lt;P&gt;For detailed expression guidance, refer to &lt;A href="https://community.qlik.com/t5/App-Development/Before-function-in-Qlik-Sense-Saas-and-null-values/m-p/2523359#M106784" target="_self"&gt;Qlik's official documentation&lt;/A&gt;. Let me know if you need help implementing this in your pivot table!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Nov 2025 08:48:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Before-function-in-Qlik-Sense-Saas-and-null-values/m-p/2537384#M108808</guid>
      <dc:creator>jackandero</dc:creator>
      <dc:date>2025-11-27T08:48:36Z</dc:date>
    </item>
  </channel>
</rss>

