<?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: Ageing buckets with calculated dimension and date variable in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Ageing-buckets-with-calculated-dimension-and-date-variable/m-p/1287792#M27115</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to share a sample to show the issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Mar 2017 18:15:53 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2017-03-27T18:15:53Z</dc:date>
    <item>
      <title>Ageing buckets with calculated dimension and date variable</title>
      <link>https://community.qlik.com/t5/App-Development/Ageing-buckets-with-calculated-dimension-and-date-variable/m-p/1287791#M27114</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;I have a calculated dimension that I am using to form the columns in a pivot table (to create ageing buckets):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF((Date(vSnapshotDate) - Date([Z_Calc due date])) &amp;lt;= 0, '1. Current',&lt;/P&gt;&lt;P&gt;IF((Date(vSnapshotDate) - Date([Z_Calc due date])) &amp;lt;= 30, '2. &amp;lt;=30',&lt;/P&gt;&lt;P&gt;IF((Date(vSnapshotDate) - Date([Z_Calc due date])) &amp;lt;= 60, '3. &amp;lt;=60',&lt;/P&gt;&lt;P&gt;IF((Date(vSnapshotDate) - Date([Z_Calc due date])) &amp;lt;= 90, '4. &amp;lt;=90',&lt;/P&gt;&lt;P&gt;IF((Date(vSnapshotDate) - Date([Z_Calc due date])) &amp;lt;= 180, '5. &amp;lt;=180',&lt;/P&gt;&lt;P&gt;IF((Date(vSnapshotDate) - Date([Z_Calc due date])) &amp;lt;= 360, '6. &amp;lt;=360',&lt;/P&gt;&lt;P&gt;IF((Date(vSnapshotDate) - Date([Z_Calc due date])) &amp;gt; 360, '7. &amp;gt;360',&lt;/P&gt;&lt;P&gt;'0.Unknown')))))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vSnapshotDate is a variable that is set via the user selecting a date from a drop-down (option variable) list. &lt;SPAN style="font-size: 10pt;"&gt;The variable is definitely getting updated correctly, as it is populating and updating in a straight table. &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;The total of the columns in the pivot table are also correctly updating based on the selection of vSnapshotDate. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;However, the split of that total between the buckets is not correct.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I add the above expression to a straight table as a dimension, I can see that it &lt;STRONG&gt;does not&lt;/STRONG&gt; calculate correctly. However, if I add it as a measure to the straight table then &lt;STRONG&gt;it is&lt;/STRONG&gt; calculating correctly. I think when used as a dimension, it is not recalculating based on the current value of vSnapshot date, but is instead 'remembering' the result of the first vSnapshotDate selection and result of that calculation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So clearly there is an issue with getting the expression to evaluate correctly on change of vSnapshotDate when it is added to an object as a dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody advise on how to create this bucketing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data set loaded is at the most granular transactional level, and the calculation of Date(vSnapshotDate) - Date([Z_Calc due date]) is applicable to each row of the data set (i.e. no aggregation needed). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot use the class function (due to irregular bucket sizes required by the client), and I cannot create buckets in the load script due to the user dynamically setting the snapshot date variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2017 18:12:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Ageing-buckets-with-calculated-dimension-and-date-variable/m-p/1287791#M27114</guid>
      <dc:creator />
      <dc:date>2017-03-27T18:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: Ageing buckets with calculated dimension and date variable</title>
      <link>https://community.qlik.com/t5/App-Development/Ageing-buckets-with-calculated-dimension-and-date-variable/m-p/1287792#M27115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to share a sample to show the issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2017 18:15:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Ageing-buckets-with-calculated-dimension-and-date-variable/m-p/1287792#M27115</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-27T18:15:53Z</dc:date>
    </item>
  </channel>
</rss>

