<?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: Set Analysis, variable and deduction in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-and-deduction/m-p/424648#M1149908</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;You need to serialise your dates. Create a new field in the script for the table in question. The expressio for the new field will be&lt;/P&gt;&lt;P&gt;num(Sales_DATE_NEW) as SalesDateNewSerial .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You then need to create 2 variables one to capture the user input and one to manipulate this value into the one you require.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The $(varibleName) will try and evaluate what ever is inside the 2 brackets. So if varibleName is = 23/12/2012 it will divide 23 by 12 then by 2013 giving you a small number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the attached application for more details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 May 2013 17:36:19 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-05-03T17:36:19Z</dc:date>
    <item>
      <title>Set Analysis, variable and deduction</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-and-deduction/m-p/424643#M1149903</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 an input box in which users can add a date (vComparableDate). I compute the sales for the day (using set analysis) belonging to the input date as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=SUM({1&amp;lt;Sales_DATE_NEW={'$(=vComparableDate)'}&amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to compute the sales belonging to vComparableDate-1 for the previous day, but unfortunately I don't know the relevant syntax and cant find it either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Can anyone help me out?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If only it was this easy:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; =SUM({1&amp;lt;Sales_DATE_NEW={'$(=vComparableDate)-1'}&amp;gt;} Sales)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Daniel&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 May 2013 13:53:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-and-deduction/m-p/424643#M1149903</guid>
      <dc:creator />
      <dc:date>2013-05-03T13:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis, variable and deduction</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-and-deduction/m-p/424644#M1149904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All dates can be transformed into numbers with "num" function&lt;/P&gt;&lt;P&gt;if you add -1 to the number obtained you are in "yesterday" ... then transform it again in date so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;date(num(vComparableDate)-1) could work ... check syntax ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 May 2013 14:08:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-and-deduction/m-p/424644#M1149904</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2013-05-03T14:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis, variable and deduction</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-and-deduction/m-p/424645#M1149905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Alexandros,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the suggestion but unfortunately I can't get it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried many ways, among others:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=SUM({1&amp;lt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Sales_DATE_NEW&lt;/SPAN&gt;={'$(Num(vComparableDate)-1)'}&amp;gt;} &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Sales&lt;/SPAN&gt;).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 May 2013 14:21:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-and-deduction/m-p/424645#M1149905</guid>
      <dc:creator />
      <dc:date>2013-05-03T14:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis, variable and deduction</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-and-deduction/m-p/424646#M1149906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM({1&amp;lt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Sales_DATE_NEW&lt;/SPAN&gt;={'$(=Date(Num($(vComparableDate))-1),'dd/MM/yyyy')'}&amp;gt;} &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Sales&lt;/SPAN&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 May 2013 14:36:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-and-deduction/m-p/424646#M1149906</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2013-05-03T14:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis, variable and deduction</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-and-deduction/m-p/424647#M1149907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately it didn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps I need to explain more:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;on certain days (black sunday, easter and so on) sales will skyrocket. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to offer the functionality to type a certain date in an input box, and see how much the sales on that day went up or down compared to the previous day. (I will also use this figure for forecasting purposes later on).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, the input box behaves strangely. If I put in 02/03/2012 I can compute &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;=SUM({1&amp;lt;Sales_DATE_NEW={'$(=vComparableDate)'}&amp;gt;} Sales)&lt;/SPAN&gt; and it will return the sales for 02/03/2012. However if I use a num function it will divide 2 by (3*2012), giving a very low figure. Recasting that num to a date will return a date in the 19th century..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So before I can even continue I need to have a reliable way to cast "human" dates to a num... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is getting more complicated than I initially thought..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 May 2013 15:15:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-and-deduction/m-p/424647#M1149907</guid>
      <dc:creator />
      <dc:date>2013-05-03T15:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis, variable and deduction</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-and-deduction/m-p/424648#M1149908</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;You need to serialise your dates. Create a new field in the script for the table in question. The expressio for the new field will be&lt;/P&gt;&lt;P&gt;num(Sales_DATE_NEW) as SalesDateNewSerial .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You then need to create 2 variables one to capture the user input and one to manipulate this value into the one you require.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The $(varibleName) will try and evaluate what ever is inside the 2 brackets. So if varibleName is = 23/12/2012 it will divide 23 by 12 then by 2013 giving you a small number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the attached application for more details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 May 2013 17:36:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-and-deduction/m-p/424648#M1149908</guid>
      <dc:creator />
      <dc:date>2013-05-03T17:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis, variable and deduction</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-and-deduction/m-p/424649#M1149909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Matt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the problem isn't in the dates, they are serialized.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rather I want to offer the user the opportunity to set a range of parameters (such as a date for comparison, number of days and so on). These parameters will then be used to perform a range of operations on the data (serialized, clean).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that I can't get the input box to translate a date a user would enter (5/3/2013) to a serialized date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course I can offer the user the opportunity to select a date through a listbox, and then set a variable as the last date in the selection (offering the same functionality). However this is not the preferred solution because the user would need to enter the date in a listbox and other parameters in an input box. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do you typically allow users to set parameters for your applications?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 May 2013 17:57:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-and-deduction/m-p/424649#M1149909</guid>
      <dc:creator />
      <dc:date>2013-05-03T17:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis, variable and deduction</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-and-deduction/m-p/424650#M1149910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my test file attached I have 2 varibles one takes the user input and the other manipulates this value by subtracting one day off it. It is this second varible that is used in the set anaysis equation. Open up the varible expressions from the Settings&amp;gt;Varible Overview. You will see the what I am doing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KR Matt.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 May 2013 18:16:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-and-deduction/m-p/424650#M1149910</guid>
      <dc:creator />
      <dc:date>2013-05-03T18:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis, variable and deduction</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-and-deduction/m-p/424651#M1149911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Matt!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ended up having to create way more variables than I wanted, but at least this is workable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 May 2013 10:57:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-variable-and-deduction/m-p/424651#M1149911</guid>
      <dc:creator />
      <dc:date>2013-05-06T10:57:47Z</dc:date>
    </item>
  </channel>
</rss>

