<?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: Derived AutoCalendar Fields and Set Analysis Expressions in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Derived-AutoCalendar-Fields-and-Set-Analysis-Expressions/m-p/1746629#M57331</link>
    <description>&lt;P&gt;Thanks for replying!&lt;/P&gt;&lt;P&gt;I didn't realize I needed the first of the month to match what the autoCalendar is doing. I'm initializing my variable like this in the data load editor.&lt;/P&gt;&lt;P&gt;LET vEndDate = Date(MonthStart(Date(Today()-1, 'YYYY-MMM')),'YYYY-MMM');&lt;/P&gt;&lt;P&gt;I did it this way because I'm guessing I need the YYYY-MMM format to match how autoCalendar makes it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dual(Year($1)&amp;amp;'-'&amp;amp;Month($1), monthstart($1)) AS [YearMonth] Tagged ('$axis', '$yearmonth', '$qualified'),&lt;/P&gt;&lt;P&gt;$(vEndDate) on it's own in the set analysis and expands out to "2020-Sept" at the preview on the bottom.&lt;/P&gt;&lt;P&gt;[SALES_POSTED_DATE.autoCalendar.YearMonth]={"$(vEndDate)"}&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2020-09-23 224615.png" style="width: 842px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/41107iC78D97475D973EC1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2020-09-23 224615.png" alt="Screenshot 2020-09-23 224615.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've used your recommendation but all I get is the hypen. Are we able to modify these derived fields using expressions?&lt;/P&gt;&lt;P&gt;[SALES_POSTED_DATE.autoCalendar.YearMonth]={"$(=MonthStart(AddMonths($(vEndDate),-1)))"}&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2020-09-23 2248501.png" style="width: 762px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/41108i188AC8B52B254A14/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2020-09-23 2248501.png" alt="Screenshot 2020-09-23 2248501.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;I'm using this to create the autoCalendar.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Sep 2020 03:50:48 GMT</pubDate>
    <dc:creator>smithc2005</dc:creator>
    <dc:date>2020-09-24T03:50:48Z</dc:date>
    <item>
      <title>Derived AutoCalendar Fields and Set Analysis Expressions</title>
      <link>https://community.qlik.com/t5/App-Development/Derived-AutoCalendar-Fields-and-Set-Analysis-Expressions/m-p/1746572#M57325</link>
      <description>&lt;P&gt;Good Afternoon !&amp;nbsp;&lt;/P&gt;&lt;P&gt;This one is killing me. I am trying to subtract months from a derived Year Date field to use it as a set expression in my set analysis. Am I getting the format wrong? It's returning zero if I don't explicitly use my date variable set in the load script.&lt;/P&gt;&lt;P&gt;This is the part of the expression in question.&lt;/P&gt;&lt;P&gt;Variable is initially set this way;&lt;/P&gt;&lt;P&gt;LET vEndDate = Date(Today()-1,'YYYY-MMM');&lt;/P&gt;&lt;P&gt;Works :&lt;/P&gt;&lt;P&gt;[DATE1.autoCalendar.YearMonth]={"$(vEndDate)"}&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does not work:&lt;/P&gt;&lt;P&gt;[DATE1.autoCalendar.YearMonth]={"$(=Date(AddMonths(Date#($(vEndDate),'YYYY-MMM'),-1),'YYYY-MMM'))"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I not thinking through this correctly, below?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2020-09-23 151042.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/41093i9615BA1BFB2F5B72/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2020-09-23 151042.png" alt="Screenshot 2020-09-23 151042.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:23:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Derived-AutoCalendar-Fields-and-Set-Analysis-Expressions/m-p/1746572#M57325</guid>
      <dc:creator>smithc2005</dc:creator>
      <dc:date>2024-11-16T01:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Derived AutoCalendar Fields and Set Analysis Expressions</title>
      <link>https://community.qlik.com/t5/App-Development/Derived-AutoCalendar-Fields-and-Set-Analysis-Expressions/m-p/1746610#M57330</link>
      <description>&lt;P&gt;Remembering that the Date function only changes the presentation and the YearMonth is stored internally as a number. So format is not the issue.&lt;/P&gt;&lt;P&gt;MonthStart(AddMonths(Date(Today()-1, 'YYYY-MMM'),-1)) will give you the correct date that should match your set analysis because you need the 1st of the Month.&lt;/P&gt;&lt;P&gt;My recommendation is :&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[DATE1.autoCalendar.YearMonth]={"$(=MonthStart(AddMonths($(vEndDate),-1))"}&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 01:53:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Derived-AutoCalendar-Fields-and-Set-Analysis-Expressions/m-p/1746610#M57330</guid>
      <dc:creator>Lisa_P</dc:creator>
      <dc:date>2020-09-24T01:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Derived AutoCalendar Fields and Set Analysis Expressions</title>
      <link>https://community.qlik.com/t5/App-Development/Derived-AutoCalendar-Fields-and-Set-Analysis-Expressions/m-p/1746629#M57331</link>
      <description>&lt;P&gt;Thanks for replying!&lt;/P&gt;&lt;P&gt;I didn't realize I needed the first of the month to match what the autoCalendar is doing. I'm initializing my variable like this in the data load editor.&lt;/P&gt;&lt;P&gt;LET vEndDate = Date(MonthStart(Date(Today()-1, 'YYYY-MMM')),'YYYY-MMM');&lt;/P&gt;&lt;P&gt;I did it this way because I'm guessing I need the YYYY-MMM format to match how autoCalendar makes it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dual(Year($1)&amp;amp;'-'&amp;amp;Month($1), monthstart($1)) AS [YearMonth] Tagged ('$axis', '$yearmonth', '$qualified'),&lt;/P&gt;&lt;P&gt;$(vEndDate) on it's own in the set analysis and expands out to "2020-Sept" at the preview on the bottom.&lt;/P&gt;&lt;P&gt;[SALES_POSTED_DATE.autoCalendar.YearMonth]={"$(vEndDate)"}&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2020-09-23 224615.png" style="width: 842px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/41107iC78D97475D973EC1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2020-09-23 224615.png" alt="Screenshot 2020-09-23 224615.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've used your recommendation but all I get is the hypen. Are we able to modify these derived fields using expressions?&lt;/P&gt;&lt;P&gt;[SALES_POSTED_DATE.autoCalendar.YearMonth]={"$(=MonthStart(AddMonths($(vEndDate),-1)))"}&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2020-09-23 2248501.png" style="width: 762px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/41108i188AC8B52B254A14/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2020-09-23 2248501.png" alt="Screenshot 2020-09-23 2248501.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;I'm using this to create the autoCalendar.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 03:50:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Derived-AutoCalendar-Fields-and-Set-Analysis-Expressions/m-p/1746629#M57331</guid>
      <dc:creator>smithc2005</dc:creator>
      <dc:date>2020-09-24T03:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Derived AutoCalendar Fields and Set Analysis Expressions</title>
      <link>https://community.qlik.com/t5/App-Development/Derived-AutoCalendar-Fields-and-Set-Analysis-Expressions/m-p/1746890#M57376</link>
      <description>&lt;P&gt;Found it!&lt;/P&gt;&lt;P&gt;Removing the dollar sign expansion on the variable worked I'm not sure why, though. Does anyone know why ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[SALES_POSTED_DATE.autoCalendar.YearMonth]={"$(=Date(MonthStart(AddMonths(vEndDate,-1)),'YYYY-MMM'))"}&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 16:36:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Derived-AutoCalendar-Fields-and-Set-Analysis-Expressions/m-p/1746890#M57376</guid>
      <dc:creator>smithc2005</dc:creator>
      <dc:date>2020-09-24T16:36:01Z</dc:date>
    </item>
  </channel>
</rss>

