<?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: Previous N months date selection, performance issue in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Previous-N-months-date-selection-performance-issue/m-p/1255465#M850585</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of Single expression, create 4 expression for each Criteria (Last 12 Months, Last 9 months, etc.)&lt;/P&gt;&lt;P&gt;create 4 more variables and assign to the button.&lt;/P&gt;&lt;P&gt;Then, Using that variable in the 'Expressions' tab - &lt;STRONG&gt;Conditional&lt;/STRONG&gt; display option to show or hide that expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Mar 2017 20:00:48 GMT</pubDate>
    <dc:creator>settu_periasamy</dc:creator>
    <dc:date>2017-03-08T20:00:48Z</dc:date>
    <item>
      <title>Previous N months date selection, performance issue</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-N-months-date-selection-performance-issue/m-p/1255464#M850584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm facing an performance issue in my dashboard. I'm explaining it below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H5&gt;What I have?&lt;/H5&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;1. Fact table data size: 20 lakhs records.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2. Build Calendar using the concept found in this blog post- &lt;A href="https://qlikviewcookbook.com/2015/05/better-calendar-scripts/" title="https://qlikviewcookbook.com/2015/05/better-calendar-scripts/" target="_blank"&gt;https://qlikviewcookbook.com/2015/05/better-calendar-scripts/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;3. Calendar Master is connected to Fact table by DateKey.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;4. I have 4 buttons in my dashboard. "Last 12 Months", &lt;SPAN style="font-size: 13.3333px;"&gt;"Last 9 Months"&lt;/SPAN&gt;, &lt;SPAN style="font-size: 13.3333px;"&gt;"Last 6 Months"&lt;/SPAN&gt;, &lt;SPAN style="font-size: 13.3333px;"&gt;"Last 3 Months".&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;5. I'm showing &lt;STRONG&gt;Count &lt;/STRONG&gt;of measure in a straight table. &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;6. Straight table has Month-Year as dimensions and one expression.&lt;/P&gt;&lt;H5&gt;&lt;/H5&gt;&lt;H5&gt;Requirements:&lt;/H5&gt;&lt;P&gt;1. On click of the buttons, the charts should filter date range and update chart values.&lt;/P&gt;&lt;P&gt;e.g. standing in today's date (9-Mar-2017), when I select 2016 and "Last 12 Months button", the charts should show values from &lt;/P&gt;&lt;P&gt;01-Jan-2016 to 31-Dec-2016. But if 2017 is selected it should show values from 01-Mar-2016 to 28-Feb-2017, i.e. it will always show 12 full months.&lt;/P&gt;&lt;P&gt;2. If I select any Month or Quarter the chart should show values for that month or quarter only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H5&gt;My solution:&lt;/H5&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;1. For each button I've created trigger (External -&amp;gt; Set Variables).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;2. Wrote below expression in chart-&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;If(GetSelectedCount(Month) =0 and &lt;SPAN style="font-size: 13.3333px;"&gt;GetSelectedCount(Quarter)=0,&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pick(Match(vDateRange, 'Last_12_months', 'Last_9_months', 'Last_6_months', 'Last_3_months'),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(&amp;nbsp; {&amp;lt;TranDate={"&amp;gt;=$(vLast_12_Months_Start_Date)&amp;lt;=$(vLast_12_Months_End_Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)"}, Year=, Month=, Month_Year=, Day=&amp;gt;}&amp;nbsp; &amp;lt;Measure&amp;gt;),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 8pt;"&gt;Sum(&amp;nbsp; {&amp;lt;TranDate={"&amp;gt;=$(vLast_09_Months_Start_Date)&amp;lt;=$(vLast_09_Months_End_Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)"}, Year=, Month=, Month_Year=, Day=&amp;gt;}&amp;nbsp; &amp;lt;Measure&amp;gt;)&lt;/SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(&amp;nbsp; {&amp;lt;TranDate={"&amp;gt;=$(vLast_06_Months_Start_Date)&amp;lt;=$(vLast_06_Months_End_Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)"}, Year=, Month=, Month_Year=, Day=&amp;gt;}&amp;nbsp; &amp;lt;Measure&amp;gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 8pt;"&gt;Sum(&amp;nbsp; {&amp;lt;TranDate={"&amp;gt;=$(vLast_03_Months_Start_Date)&amp;lt;=$(vLast_03_Months_End_Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)"}, Year=, Month=, Month_Year=, Day=&amp;gt;}&amp;nbsp; &amp;lt;Measure&amp;gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Sum(&amp;lt;Measure&amp;gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H5&gt;Problem:&lt;/H5&gt;&lt;P&gt;Although the above expression is giving correct output but when I'm opening the dashboard the chart is opening very slowly. Waiting time 15-20 secs, sometimes even more. Remember I've 20 lakhs records in the fact. Guide me to increase the performance. If any change in the script can be better option then it is fine for me. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be appreciated. Its very urgent. Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Joy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-N-months-date-selection-performance-issue/m-p/1255464#M850584</guid>
      <dc:creator>joydipp1988</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Previous N months date selection, performance issue</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-N-months-date-selection-performance-issue/m-p/1255465#M850585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of Single expression, create 4 expression for each Criteria (Last 12 Months, Last 9 months, etc.)&lt;/P&gt;&lt;P&gt;create 4 more variables and assign to the button.&lt;/P&gt;&lt;P&gt;Then, Using that variable in the 'Expressions' tab - &lt;STRONG&gt;Conditional&lt;/STRONG&gt; display option to show or hide that expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Mar 2017 20:00:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-N-months-date-selection-performance-issue/m-p/1255465#M850585</guid>
      <dc:creator>settu_periasamy</dc:creator>
      <dc:date>2017-03-08T20:00:48Z</dc:date>
    </item>
  </channel>
</rss>

