<?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: Filtering with variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Filtering-with-variables/m-p/300702#M711985</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Eureka!&lt;/P&gt;&lt;P&gt;Finally I got the result...and it was quite easy!&lt;/P&gt;&lt;P&gt;here the step-by-step creation I've used. If someone has suggestion to improov it...welkome!&lt;/P&gt;&lt;P&gt;Sergiovery&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming a popolated DB source (in my case it is a 500'000records DB) with these fields:&lt;BR /&gt;- CustomerID&lt;BR /&gt;- ProductID&lt;BR /&gt;- AreaID&lt;BR /&gt;- Date&lt;BR /&gt;- Turnover&lt;/P&gt;&lt;P&gt;Importation Script:&lt;BR /&gt;ODBC CONNECT TO [MS Access Database;DBQ=...\Repository\SourceDB.mdb];&lt;BR /&gt;SQL SELECT `CustomerID` as CodCli,&lt;BR /&gt; `ProductID` as CodProd,&lt;BR /&gt; `AreaID` as CodArea,&lt;BR /&gt; `Data`,&lt;BR /&gt; Format(`Data`, 'yyyy-mm-dd') as SimpleDate, &lt;BR /&gt; `Invoiced Sales` as Turnover,&lt;/P&gt;&lt;P&gt;FROM MainDB;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I add 2 variables in Variables Manager &lt;BR /&gt; vDataMin - with vDataMin=Min(SimpleDate)&lt;BR /&gt; vDataMax - with vDataMax=Max(SimpleDate)&lt;BR /&gt;2. I create 2 Slider/Calendar objects on my canvass with these parameters:&lt;BR /&gt; Object 1&lt;BR /&gt; Style: Calendar&lt;BR /&gt; Title: "From date"&lt;BR /&gt; Field: Variable --&amp;gt; vDataMin&lt;BR /&gt; Minimum value: Min(SimpleDate)&lt;BR /&gt; Maximum value: Max(SimpleDate)&lt;BR /&gt; Modus: "Single value"&lt;BR /&gt; Object 2&lt;BR /&gt; Style: Calendar&lt;BR /&gt; Title: "Up to date"&lt;BR /&gt; Field: Variable --&amp;gt; vDataMax&lt;BR /&gt; Minimum value : vDataMin&lt;BR /&gt; Maximum value: Max(SimpleDate)&lt;BR /&gt; Modus: "Single value"&lt;BR /&gt;3. In a new Table Object I create 2 expressions to calculate the turnover sum by Customer/Product/Area&lt;BR /&gt; Dimensions: CodCli/CodProd/CodArea&lt;/P&gt;&lt;P&gt; Expression Titles: "TurnoverCY"; "Turnover PY" (Current yera/Previous year)&lt;BR /&gt; Expressions:&lt;BR /&gt; for "TurnoverCY" --&amp;gt; Sum({&amp;lt; SimpleDate = {'&amp;gt;=$(=Date(vDataMin))&amp;lt;=$(=Date(vDataMax))'} &amp;gt;} Turnover)&lt;BR /&gt; for "TurnoverPY" --&amp;gt; Sum({&amp;lt; SimpleDate = {'&amp;gt;=$(=Date(addmonths(cDataMin,-12)))&amp;lt;=$(=Date(addmonths(vDataMax,-12)))'} &amp;gt;} Turnover)&lt;BR /&gt;...and that's it!&lt;/P&gt;&lt;P&gt;Note - Being using QV with the Local language, it maybe some titles/elments have different titles in your english/local language.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Dec 2011 15:49:28 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-12-01T15:49:28Z</dc:date>
    <item>
      <title>Filtering with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Filtering-with-variables/m-p/300696#M711979</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've a table with some fields, one of this field is called DTConsCustOrdToUGO and i need to filter it using startDate and EndDate.&lt;/P&gt;&lt;P&gt;I've done these two calendar and i've assigned a trigger event on the variable (only for StarDate) but i need to filter DTConsCustOrdToUGO between StartDate and EndDate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone can help?&lt;/P&gt;&lt;P&gt;attacched the file i've done.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jun 2011 20:46:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filtering-with-variables/m-p/300696#M711979</guid>
      <dc:creator />
      <dc:date>2011-06-18T20:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Filtering-with-variables/m-p/300697#M711980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Selecting a range of values in a ListBox based on the beginning value and ending value of the range specified in two other (Slider or Calendar or ListBox) objects is a topic addressed in the forum several times in the past by several QlikView experts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on the knowledge gained from those posts, I have attached a qvw file giving one way of solving this. I do not take the credit for the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jun 2011 22:29:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filtering-with-variables/m-p/300697#M711980</guid>
      <dc:creator>nagaiank</dc:creator>
      <dc:date>2011-06-18T22:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Filtering-with-variables/m-p/300698#M711981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;But i'm newby about qlikview and i really don't understand how you have solved the problem.&lt;/P&gt;&lt;P&gt;I'm using QV8.5 and don't know if this version has a bug but on my installation the selection won't work..&lt;/P&gt;&lt;P&gt;Have you done a trigger? a macro? please tell me how you've solved the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Jun 2011 19:01:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filtering-with-variables/m-p/300698#M711981</guid>
      <dc:creator />
      <dc:date>2011-06-19T19:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Filtering-with-variables/m-p/300699#M711982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use version 10. Here is the list of what I did.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(1) I added a listbox for the field DTConsCustOrdToUGO.&lt;/P&gt;&lt;P&gt;(2) I did not use macros.&lt;/P&gt;&lt;P&gt;(3) I added event triggers for the fields DataFine and DataInizio for OnInput and OnChange events.&lt;/P&gt;&lt;P&gt;(4) The trigger action is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Select in Field&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DTConsCustOrdToUGO&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Search String:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ='&amp;gt;='&amp;amp;Date(DataInizio)&amp;amp;'&amp;lt;='&amp;amp;Date(DataFine)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;﻿&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Jun 2011 21:11:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filtering-with-variables/m-p/300699#M711982</guid>
      <dc:creator>nagaiank</dc:creator>
      <dc:date>2011-06-19T21:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Filtering-with-variables/m-p/300700#M711983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your fast reply &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/krishnamoorthy" id="jive-382703928634471773898"&gt;krishnamoorthy&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Unfortunatly i've understand that your method is not supported on my version.&lt;/P&gt;&lt;P&gt;I've to find another way to solve the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone can help , in the meantime i'll check the forum.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 10:01:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filtering-with-variables/m-p/300700#M711983</guid>
      <dc:creator />
      <dc:date>2011-06-20T10:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Filtering-with-variables/m-p/300701#M711984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello there!&lt;/P&gt;&lt;P&gt;I'm really a very entry-level user both in SQL and in QV. So...please be patient with me! &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'm in the same situation: I've to filter the values of Turnover by a date-range set by the end-user.&lt;/P&gt;&lt;P&gt;Here is the situation:&lt;/P&gt;&lt;P&gt;1. I have a pivot-table with 3 columns:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.1. Sales manager name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.2. CurrentYear Turnover --&amp;gt; sum({&amp;lt;Year={$(=[Year]-1)}&amp;gt;} [Invoiced Sales])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.3. PreviousYear Turnover --&amp;gt; sum({&amp;lt;Year={$(=[Year]-1)}&amp;gt;} [Invoiced Sales])&lt;/P&gt;&lt;P&gt; 2. I have 2 objects on the canvass created on the base of 1 field during the DBSource importation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.1&amp;nbsp; SQL=&amp;gt;&amp;nbsp; Year('Date') as Year --&amp;gt; With this filed I've created the first object: the "Year" table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.2&amp;nbsp; SQL=&amp;gt;&amp;nbsp;&amp;nbsp; Month('Date') as Month --&amp;gt; With this filed I've created the second object: the "Month" table&amp;nbsp; &lt;/P&gt;&lt;P&gt;The 2 objects used on the canvass filter the pivot-table on the base of the Year/Month information...but here is the problem of mine.&lt;/P&gt;&lt;P&gt;This engine visualize the value "per month" (as correctly requested...). This because I was not able to realize what I really need!&lt;/P&gt;&lt;P&gt;I would like to filter the pivot-table referring, instead to Year/Month, to specific date-range (i.e. from 15/01/2011 up to 22/04/2011).&lt;/P&gt;&lt;P&gt;I've spend a lot of time in trying to find out the solution with a (welkome) data-range-filter object...but it seams to me that this object doesen't exist &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've also tried to adapt the nice example of Krishnamoorthy....but again I failed &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can anybody help me!?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I have to create the StartDate object and the EndDate one on my canvass in order to filter the pivot-table accordingly to the dates set by the end-user?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your support&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2011 12:07:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filtering-with-variables/m-p/300701#M711984</guid>
      <dc:creator />
      <dc:date>2011-11-28T12:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Filtering-with-variables/m-p/300702#M711985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Eureka!&lt;/P&gt;&lt;P&gt;Finally I got the result...and it was quite easy!&lt;/P&gt;&lt;P&gt;here the step-by-step creation I've used. If someone has suggestion to improov it...welkome!&lt;/P&gt;&lt;P&gt;Sergiovery&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming a popolated DB source (in my case it is a 500'000records DB) with these fields:&lt;BR /&gt;- CustomerID&lt;BR /&gt;- ProductID&lt;BR /&gt;- AreaID&lt;BR /&gt;- Date&lt;BR /&gt;- Turnover&lt;/P&gt;&lt;P&gt;Importation Script:&lt;BR /&gt;ODBC CONNECT TO [MS Access Database;DBQ=...\Repository\SourceDB.mdb];&lt;BR /&gt;SQL SELECT `CustomerID` as CodCli,&lt;BR /&gt; `ProductID` as CodProd,&lt;BR /&gt; `AreaID` as CodArea,&lt;BR /&gt; `Data`,&lt;BR /&gt; Format(`Data`, 'yyyy-mm-dd') as SimpleDate, &lt;BR /&gt; `Invoiced Sales` as Turnover,&lt;/P&gt;&lt;P&gt;FROM MainDB;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I add 2 variables in Variables Manager &lt;BR /&gt; vDataMin - with vDataMin=Min(SimpleDate)&lt;BR /&gt; vDataMax - with vDataMax=Max(SimpleDate)&lt;BR /&gt;2. I create 2 Slider/Calendar objects on my canvass with these parameters:&lt;BR /&gt; Object 1&lt;BR /&gt; Style: Calendar&lt;BR /&gt; Title: "From date"&lt;BR /&gt; Field: Variable --&amp;gt; vDataMin&lt;BR /&gt; Minimum value: Min(SimpleDate)&lt;BR /&gt; Maximum value: Max(SimpleDate)&lt;BR /&gt; Modus: "Single value"&lt;BR /&gt; Object 2&lt;BR /&gt; Style: Calendar&lt;BR /&gt; Title: "Up to date"&lt;BR /&gt; Field: Variable --&amp;gt; vDataMax&lt;BR /&gt; Minimum value : vDataMin&lt;BR /&gt; Maximum value: Max(SimpleDate)&lt;BR /&gt; Modus: "Single value"&lt;BR /&gt;3. In a new Table Object I create 2 expressions to calculate the turnover sum by Customer/Product/Area&lt;BR /&gt; Dimensions: CodCli/CodProd/CodArea&lt;/P&gt;&lt;P&gt; Expression Titles: "TurnoverCY"; "Turnover PY" (Current yera/Previous year)&lt;BR /&gt; Expressions:&lt;BR /&gt; for "TurnoverCY" --&amp;gt; Sum({&amp;lt; SimpleDate = {'&amp;gt;=$(=Date(vDataMin))&amp;lt;=$(=Date(vDataMax))'} &amp;gt;} Turnover)&lt;BR /&gt; for "TurnoverPY" --&amp;gt; Sum({&amp;lt; SimpleDate = {'&amp;gt;=$(=Date(addmonths(cDataMin,-12)))&amp;lt;=$(=Date(addmonths(vDataMax,-12)))'} &amp;gt;} Turnover)&lt;BR /&gt;...and that's it!&lt;/P&gt;&lt;P&gt;Note - Being using QV with the Local language, it maybe some titles/elments have different titles in your english/local language.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 15:49:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filtering-with-variables/m-p/300702#M711985</guid>
      <dc:creator />
      <dc:date>2011-12-01T15:49:28Z</dc:date>
    </item>
  </channel>
</rss>

