<?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: Load as (new dimension) but between two dates using today() in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Load-as-new-dimension-but-between-two-dates-using-today/m-p/2072015#M87939</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/135319"&gt;@Daryn&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please refer the below link&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-App-Dev/how-to-create-bucket-for-date/td-p/1939575#:~:text=You%20can%20do%20this%20using%20an%20nested%20if,%28%29%20-%20date%23%20%28OrderDate%2C%20%27DD-MMM-YY%27%29%3C90%2C%20%2761-90%20days%27%2C%27%3E90%20days%27%29%29%29" target="_blank" rel="noopener"&gt;Solved: how to create bucket for date - Qlik Community - 1939575&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;First.&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;You need to ensure that you can interpret the date values as date. If they aren't date values then you can do this: date#(&lt;SPAN&gt;[FKDAT]&lt;/SPAN&gt;, 'DD-MMM-YY')&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Second&lt;/STRONG&gt;&amp;nbsp; You need to identify your comparison date. I assume you want to compare with today's date&amp;nbsp; You can use today()&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Third:&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;To get the no of days between your &lt;SPAN&gt;[FKDAT]&lt;/SPAN&gt;and your comparison date use subtraction, like this:&lt;/P&gt;
&lt;P&gt;today () - date#(&lt;SPAN&gt;[FKDAT]&lt;/SPAN&gt;, 'DD-MMM-YY')&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Fourth.&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Bucket your date diff. You can do this using an nested if statement or using interval match. For this example I'll use an nestled if statement like this.&lt;/P&gt;
&lt;P&gt;IF(today () - date#(&lt;SPAN&gt;[FKDAT]&lt;/SPAN&gt;, 'DD-MMM-YY')&amp;lt;=30, '0-30',&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;IF(today () - date#(&lt;SPAN&gt;[FKDAT]&lt;/SPAN&gt;, 'DD-MMM-YY')&amp;lt;=60, '31-60',&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;IF(today () - date#(&lt;SPAN&gt;[FKDAT]&lt;/SPAN&gt;, 'DD-MMM-YY')&amp;lt;=90, '61-90',&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;IF(today () - date#(&lt;SPAN&gt;[FKDAT]&lt;/SPAN&gt;, 'DD-MMM-YY')&amp;lt;=120, '91-120',&lt;/P&gt;
&lt;P&gt;'121+'))))&lt;/P&gt;</description>
    <pubDate>Wed, 17 May 2023 10:29:43 GMT</pubDate>
    <dc:creator>_Iswarya_</dc:creator>
    <dc:date>2023-05-17T10:29:43Z</dc:date>
    <item>
      <title>Load as (new dimension) but between two dates using today()</title>
      <link>https://community.qlik.com/t5/App-Development/Load-as-new-dimension-but-between-two-dates-using-today/m-p/2069568#M87710</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I can't seem to get the below working, I guess I am writing it in Qlik language rather than proper SQL?&lt;/P&gt;
&lt;P&gt;I want to create a new dimension 'Aged Customers' which will contain a range of date ranges.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;0-30&lt;/P&gt;
&lt;P&gt;31-30&lt;/P&gt;
&lt;P&gt;61-90&lt;/P&gt;
&lt;P&gt;91-120&lt;/P&gt;
&lt;P&gt;121+&amp;nbsp; &amp;nbsp; &amp;nbsp;etc etc ...&amp;nbsp; &amp;nbsp;for the below I was just trying with the first couple of these to see if I could make it work)&lt;/P&gt;
&lt;P&gt;This will be used to show aged customer values across those periods.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like the below image (which is just an example I created of what I want it to look like)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Daryn_0-1683709704187.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/106811iF31C02AE4CDA9893/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Daryn_0-1683709704187.png" alt="Daryn_0-1683709704187.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So as part of my load script;&lt;/P&gt;
&lt;P&gt;Date(Date#([FKDAT], 'YYYYMMDD') ) AS [FKDAT],&lt;BR /&gt;IF([FKDAT] &amp;lt; Today() AND [FKDAT] &amp;gt; (Today()-30),'0-30', &lt;BR /&gt;IF([FKDAT] &amp;lt; (Today()-30) AND [FKDAT] &amp;gt; (Today()-60),'31-60' )) AS [Aged Customers],&lt;/P&gt;
&lt;P&gt;But that doesn't seem to work.&lt;/P&gt;
&lt;P&gt;Any guidance/solution appreciated as always,&lt;/P&gt;
&lt;P&gt;Regards Daryn&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 09:11:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-as-new-dimension-but-between-two-dates-using-today/m-p/2069568#M87710</guid>
      <dc:creator>Daryn</dc:creator>
      <dc:date>2023-05-10T09:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Load as (new dimension) but between two dates using today()</title>
      <link>https://community.qlik.com/t5/App-Development/Load-as-new-dimension-but-between-two-dates-using-today/m-p/2069574#M87711</link>
      <description>&lt;P&gt;May be try this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Date(Date#([FKDAT], 'YYYYMMDD')) AS [FKDAT],&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; IF([FKDAT] &amp;gt;= Today() - 30, '0-30',&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IF([FKDAT] &amp;gt;= Today() - 60, '31-60',&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IF([FKDAT] &amp;gt;= Today() - 90, '61-90',&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IF([FKDAT] &amp;gt;= Today() - 120, '91-120',&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; '121+'&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; ) AS [Aged Customers]&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;YourTable;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 09:20:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-as-new-dimension-but-between-two-dates-using-today/m-p/2069574#M87711</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2023-05-10T09:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Load as (new dimension) but between two dates using today()</title>
      <link>https://community.qlik.com/t5/App-Development/Load-as-new-dimension-but-between-two-dates-using-today/m-p/2069577#M87713</link>
      <description>&lt;P&gt;Hi and many thanks for taking the time to read/respond.&lt;/P&gt;
&lt;P&gt;I will try this now, but at first glance, will this only give me ranges from;&lt;/P&gt;
&lt;P&gt;today -30 days&amp;nbsp; &amp;nbsp;(ok)&lt;/P&gt;
&lt;P&gt;today - 60 days (rather than between 31 and 60 days)&lt;/P&gt;
&lt;P&gt;todays - 90 days&amp;nbsp; (rather than between 61 and 90 days) ???&lt;/P&gt;
&lt;P&gt;Will apply and check back in a few.&lt;/P&gt;
&lt;P&gt;Regards Daryn&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 09:26:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-as-new-dimension-but-between-two-dates-using-today/m-p/2069577#M87713</guid>
      <dc:creator>Daryn</dc:creator>
      <dc:date>2023-05-10T09:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Load as (new dimension) but between two dates using today()</title>
      <link>https://community.qlik.com/t5/App-Development/Load-as-new-dimension-but-between-two-dates-using-today/m-p/2069627#M87721</link>
      <description>&lt;P&gt;&amp;nbsp;Hi again, I am not getting the right results from that either, does load script not like today() ?&lt;/P&gt;
&lt;P&gt;only seeing the 121+&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Daryn_0-1683805700273.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/106928i3D4FFF18F57730A6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Daryn_0-1683805700273.png" alt="Daryn_0-1683805700273.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 06:52:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-as-new-dimension-but-between-two-dates-using-today/m-p/2069627#M87721</guid>
      <dc:creator>Daryn</dc:creator>
      <dc:date>2023-05-16T06:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: Load as (new dimension) but between two dates using today()</title>
      <link>https://community.qlik.com/t5/App-Development/Load-as-new-dimension-but-between-two-dates-using-today/m-p/2071713#M87918</link>
      <description>&lt;P&gt;Anyone, any other ideas? Many thanks again.&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 06:54:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-as-new-dimension-but-between-two-dates-using-today/m-p/2071713#M87918</guid>
      <dc:creator>Daryn</dc:creator>
      <dc:date>2023-05-16T06:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Load as (new dimension) but between two dates using today()</title>
      <link>https://community.qlik.com/t5/App-Development/Load-as-new-dimension-but-between-two-dates-using-today/m-p/2072015#M87939</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/135319"&gt;@Daryn&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please refer the below link&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-App-Dev/how-to-create-bucket-for-date/td-p/1939575#:~:text=You%20can%20do%20this%20using%20an%20nested%20if,%28%29%20-%20date%23%20%28OrderDate%2C%20%27DD-MMM-YY%27%29%3C90%2C%20%2761-90%20days%27%2C%27%3E90%20days%27%29%29%29" target="_blank" rel="noopener"&gt;Solved: how to create bucket for date - Qlik Community - 1939575&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;First.&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;You need to ensure that you can interpret the date values as date. If they aren't date values then you can do this: date#(&lt;SPAN&gt;[FKDAT]&lt;/SPAN&gt;, 'DD-MMM-YY')&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Second&lt;/STRONG&gt;&amp;nbsp; You need to identify your comparison date. I assume you want to compare with today's date&amp;nbsp; You can use today()&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Third:&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;To get the no of days between your &lt;SPAN&gt;[FKDAT]&lt;/SPAN&gt;and your comparison date use subtraction, like this:&lt;/P&gt;
&lt;P&gt;today () - date#(&lt;SPAN&gt;[FKDAT]&lt;/SPAN&gt;, 'DD-MMM-YY')&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Fourth.&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Bucket your date diff. You can do this using an nested if statement or using interval match. For this example I'll use an nestled if statement like this.&lt;/P&gt;
&lt;P&gt;IF(today () - date#(&lt;SPAN&gt;[FKDAT]&lt;/SPAN&gt;, 'DD-MMM-YY')&amp;lt;=30, '0-30',&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;IF(today () - date#(&lt;SPAN&gt;[FKDAT]&lt;/SPAN&gt;, 'DD-MMM-YY')&amp;lt;=60, '31-60',&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;IF(today () - date#(&lt;SPAN&gt;[FKDAT]&lt;/SPAN&gt;, 'DD-MMM-YY')&amp;lt;=90, '61-90',&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;IF(today () - date#(&lt;SPAN&gt;[FKDAT]&lt;/SPAN&gt;, 'DD-MMM-YY')&amp;lt;=120, '91-120',&lt;/P&gt;
&lt;P&gt;'121+'))))&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 10:29:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-as-new-dimension-but-between-two-dates-using-today/m-p/2072015#M87939</guid>
      <dc:creator>_Iswarya_</dc:creator>
      <dc:date>2023-05-17T10:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Load as (new dimension) but between two dates using today()</title>
      <link>https://community.qlik.com/t5/App-Development/Load-as-new-dimension-but-between-two-dates-using-today/m-p/2072265#M87955</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&amp;nbsp;&lt;SPAN class="UserName lia-user-name lia-user-rank-Contributor-III"&gt;&lt;SPAN class="lia-link-navigation lia-page-link lia-link-disabled lia-user-name-link" aria-disabled="true"&gt;&lt;SPAN class=""&gt;_Iswarya_,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-Contributor-III"&gt;&lt;SPAN class="lia-link-navigation lia-page-link lia-link-disabled lia-user-name-link" aria-disabled="true"&gt;&lt;SPAN class=""&gt;Huge thanks for taking the time to read and respond (and&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/25001"&gt;@Vegar&lt;/a&gt;&amp;nbsp; for the original post).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-Contributor-III"&gt;&lt;SPAN class="lia-link-navigation lia-page-link lia-link-disabled lia-user-name-link" aria-disabled="true"&gt;&lt;SPAN class=""&gt;This is great, thanks.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-Contributor-III"&gt;&lt;SPAN class="lia-link-navigation lia-page-link lia-link-disabled lia-user-name-link" aria-disabled="true"&gt;&lt;SPAN class=""&gt;I do have another question, in understanding how each line relates to the specific period, in my mind;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;IF(today () - date#(&lt;SPAN&gt;[FKDAT]&lt;/SPAN&gt;, 'DD-MMM-YY')&amp;lt;=60, '31-60',&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="messageEditor_14270dfb0d17e50_0" class="MessageEditor"&gt;&lt;A id="previewButton_14270dfb0d17e50_cdfb8" class="lia-link-navigation lia-message-editor-preview-button" href="https://community.qlik.com/t5/App-Development/Load-as-new-dimension-but-between-two-dates-using-today/m-p/2072015#" target="_blank"&gt;PREVIEW&lt;/A&gt;
&lt;DIV class="lia-js-block-events"&gt;
&lt;DIV class="lia-form-row lia-form-body-entry"&gt;
&lt;DIV class="lia-quilt-row lia-quilt-row-standard"&gt;
&lt;DIV class="lia-quilt-column lia-quilt-column-24 lia-quilt-column-single"&gt;
&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-single"&gt;
&lt;DIV class="lia-form-input-wrapper"&gt;
&lt;DIV id="rich_14270dfb0d17e50_cdfb8" class="message-body-editor lia-inline-message-body-editor"&gt;
&lt;DIV class="lia-inline-ajax-feedback"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="lia-inline-ajax-feedback"&gt;Would sum today to minus 60 days, not 31-60?&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="lia-inline-ajax-feedback"&gt;I would expect it to need;&lt;/DIV&gt;
&lt;DIV class="lia-inline-ajax-feedback"&gt;
&lt;P&gt;IF &lt;STRONG&gt;(&lt;/STRONG&gt;(today ()&lt;STRONG&gt;-31)&lt;/STRONG&gt; - date#([FKDAT], 'YYYYMMDD')&amp;lt;=60, '31-60',&lt;/P&gt;
&lt;P&gt;Are you able to explain, is it that each following line of the bucket excludes the previous range or?&lt;/P&gt;
&lt;P&gt;Thanks again and to the whole community, which is great and very helpful.&lt;/P&gt;
&lt;P&gt;Daryn&lt;/P&gt;
&lt;/DIV&gt;
&lt;DIV id="mceu_91" class="mce-tinymce mce-container mce-panel lia-editor-gte-2" tabindex="-1" role="application"&gt;
&lt;DIV id="mceu_91-body" class="mce-container-body mce-stack-layout"&gt;
&lt;DIV id="mceu_92" class="mce-top-part mce-container mce-stack-layout-item mce-first"&gt;
&lt;DIV id="mceu_92-body" class="mce-container-body"&gt;
&lt;DIV id="mceu_93" class="mce-toolbar-grp mce-container mce-panel mce-first mce-last" tabindex="-1" role="group"&gt;
&lt;DIV id="mceu_93-body" class="mce-container-body mce-stack-layout"&gt;
&lt;DIV id="mceu_94" class="mce-container mce-toolbar mce-stack-layout-item mce-first" role="toolbar"&gt;
&lt;DIV id="mceu_94-body" class="mce-container-body mce-flow-layout"&gt;
&lt;DIV id="mceu_95" class="mce-container mce-flow-layout-item mce-first mce-last mce-btn-group" role="group"&gt;
&lt;DIV id="mceu_95-body"&gt;
&lt;DIV id="mceu_53" class="mce-widget mce-btn mce-btn-small lia-mce-toolbar-bold" tabindex="-1" role="button" aria-pressed="false" aria-label="Bold"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 17 May 2023 07:51:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-as-new-dimension-but-between-two-dates-using-today/m-p/2072265#M87955</guid>
      <dc:creator>Daryn</dc:creator>
      <dc:date>2023-05-17T07:51:54Z</dc:date>
    </item>
  </channel>
</rss>

