<?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 not working in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/set-analysis-not-working/m-p/367883#M136817</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please refer to my previous context, your first mistake.&lt;/P&gt;&lt;P&gt;You used date(), instead of date#(), that's the reason why it doesn't work.&lt;/P&gt;&lt;P&gt;I have tried this function in my environment, it works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;SalesDate={"&amp;gt;=$(=date&lt;STRONG style="background-position: initial; font-size: 12px; color: #ff0000;"&gt;#&lt;/STRONG&gt;('2012/03/06','YYYY/MM/DD')&lt;SPAN style="background-position: initial; font-size: 12px; color: #ff0000;"&gt;&lt;STRONG style="background-position: initial; font-size: 12px;"&gt;+0&lt;/STRONG&gt;&lt;/SPAN&gt;)"}&amp;gt;}SalesQty)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Mar 2012 09:31:59 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-03-27T09:31:59Z</dc:date>
    <item>
      <title>set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis-not-working/m-p/367877#M136811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a set analysis problem that i can't understand why is not working. to better understand I attached a qvw file (Sales.qvw) to this thread.&lt;/P&gt;&lt;P&gt;Can anyone help me with this problem?&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Mar 2012 15:37:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis-not-working/m-p/367877#M136811</guid>
      <dc:creator>cafcptg2011</dc:creator>
      <dc:date>2012-03-24T15:37:50Z</dc:date>
    </item>
    <item>
      <title>set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis-not-working/m-p/367878#M136812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;seen your sales qvw the result that you are getting on chart Sales after Request is same as waht it contains&lt;/P&gt;&lt;P&gt;in your loded tables , i beleve you have no problem with Request which you have done as sum(Request) &lt;/P&gt;&lt;P&gt;which is showing correct value as per your loaded data and in last coloumn you are using a set analysis,&lt;/P&gt;&lt;P&gt;to find sales quantity for each product on date wise the result which you are getting is as per your loaded&lt;/P&gt;&lt;P&gt;data how can you expect values like 10, 9, 6 in last coloumn when these quantites are not recorded on&lt;/P&gt;&lt;P&gt;these dates, also instead of set analysis expression you could use sum(SalesQty) , ibelevie you must check&lt;/P&gt;&lt;P&gt;the values pesent in data model , refresh , reload the data from source such as excel , use list boxes&lt;/P&gt;&lt;P&gt;select product a select date and check the results are coming as per your expextactions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warm regards,&lt;/P&gt;&lt;P&gt;Anant Dubey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 05:44:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis-not-working/m-p/367878#M136812</guid>
      <dc:creator />
      <dc:date>2012-03-26T05:44:44Z</dc:date>
    </item>
    <item>
      <title>set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis-not-working/m-p/367879#M136813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;thanks for your reply. I will try explain better the problem. I want to know what were sales from the request dates. Basicly, I need to get Dates that are in RequesDate Column as I show in the picture below. If I put the set analysis express outside the table, for instance , in a text-object it works perfectly. Why is not working inside the table?? I realy need this, I don't know what to do more... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;CC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Sales.png" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/12417_Sales.png" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 09:01:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis-not-working/m-p/367879#M136813</guid>
      <dc:creator>cafcptg2011</dc:creator>
      <dc:date>2012-03-26T09:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis-not-working/m-p/367880#M136814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/cafcptg2011" id="jive-4784421192762409065354" onmouseout="" onmouseover="" style="background-position: initial; font-size: 12px; color: #007fc0; font-weight: bold;"&gt;cafcPTG2011&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this solution:&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;SalesDate={"&amp;gt;=$(=date&lt;STRONG style="color: #ff0000;"&gt;#&lt;/STRONG&gt;('2012/03/06','YYYY/MM/DD')&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;+0&lt;/STRONG&gt;&lt;/SPAN&gt;)"}&amp;gt;}SalesQty)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you made 2 mistakes&lt;/P&gt;&lt;P&gt;1. Date() is just used for switch display format, instead of the value. Date#() is the one you need to use. Actually not only Date(), but also Num().&lt;/P&gt;&lt;P&gt;Here is an example for you to understand:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create a straight table, define 1st expression as =Num(1/3,'#,##0.##'), 2 expression as =column(1) * 10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; take a look what happen, column 1 value is 0.33, column 2 value is 3.333333333, instead of 3.3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; That means, the value stored in memory is still the 0.3333333, it just change the display value as 0.33&lt;/P&gt;&lt;P&gt;Same thing happen for Date().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.The 2nd thing is very strange, I feel this is a defect of QV, at least it should be an enhancement request. In most of database, the date is recognized as an integer, even qlikview. In most of user case, qlikview can use date variable as both date and integer.&lt;/P&gt;&lt;P&gt;For examples, after add those expression,both these 2 are work. And then take a look for column header:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;use as a date variable:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =sum({$&amp;lt;SalesDate={"&amp;gt;=$(=&lt;SPAN style="color: #ff0000;"&gt;now()&lt;/SPAN&gt;)"}&amp;gt;}SalesQty)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;as integer (date is integer, 1day=1; the float value is for hour/min/second):&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =sum({$&amp;lt;SalesDate={"&amp;gt;=$(=&lt;SPAN style="color: #ff0000;"&gt;now()+0&lt;/SPAN&gt;)"}&amp;gt;}SalesQty)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;So, now() is working, let's try to replace it with date#(), oh, why it doesn't work?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;SalesDate={"&amp;gt;=$(=date&lt;STRONG style="color: #ff0000;"&gt;#&lt;/STRONG&gt;('2012/03/06','YYYY/MM/DD'))"}&amp;gt;}SalesQty)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Try + 0, it is workable now.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;SalesDate={"&amp;gt;=$(=date&lt;STRONG style="color: #ff0000;"&gt;#&lt;/STRONG&gt;('2012/03/06','YYYY/MM/DD')&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;+0&lt;/STRONG&gt;&lt;/SPAN&gt;)"}&amp;gt;}SalesQty)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, what happen? It just convert this value from date string to in integer. &lt;/P&gt;&lt;P&gt;I also feel confused with this result, I don't think a date variable can be a "date string", it must be int or date. So I think this is a bug of QlikView&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, my QV version is 11. I tried this solution on my environment, if not working, pls check if your version is same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 11:38:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis-not-working/m-p/367880#M136814</guid>
      <dc:creator />
      <dc:date>2012-03-26T11:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis-not-working/m-p/367881#M136815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Eeeeee, I met a strange problem after resolve this issue.&lt;/P&gt;&lt;P&gt;Here your condition is "&amp;gt;=", but how to make "=" work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For integer value, for example, year, it is very easy:&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;Year={2011,2012}&amp;gt;} SalesQty)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I tried this for SalesDate, not working. Don't know why.&lt;/P&gt;&lt;P&gt;I also tried +0, even directly put a integer value there, doesn't work neither.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 12:14:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis-not-working/m-p/367881#M136815</guid>
      <dc:creator />
      <dc:date>2012-03-26T12:14:34Z</dc:date>
    </item>
    <item>
      <title>set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis-not-working/m-p/367882#M136816</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 tried your solution but still doesn't work. please see my picture.&lt;/P&gt;&lt;P&gt;thanks &lt;/P&gt;&lt;P&gt;CC&lt;/P&gt;&lt;P&gt;&lt;IMG alt="sales1.png" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/12426_sales1.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ps: My QV version : 10.00 SR4 (x64)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 13:59:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis-not-working/m-p/367882#M136816</guid>
      <dc:creator>cafcptg2011</dc:creator>
      <dc:date>2012-03-26T13:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis-not-working/m-p/367883#M136817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please refer to my previous context, your first mistake.&lt;/P&gt;&lt;P&gt;You used date(), instead of date#(), that's the reason why it doesn't work.&lt;/P&gt;&lt;P&gt;I have tried this function in my environment, it works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;SalesDate={"&amp;gt;=$(=date&lt;STRONG style="background-position: initial; font-size: 12px; color: #ff0000;"&gt;#&lt;/STRONG&gt;('2012/03/06','YYYY/MM/DD')&lt;SPAN style="background-position: initial; font-size: 12px; color: #ff0000;"&gt;&lt;STRONG style="background-position: initial; font-size: 12px;"&gt;+0&lt;/STRONG&gt;&lt;/SPAN&gt;)"}&amp;gt;}SalesQty)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2012 09:31:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis-not-working/m-p/367883#M136817</guid>
      <dc:creator />
      <dc:date>2012-03-27T09:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis-not-working/m-p/367884#M136818</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;your expression :&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;=sum({$&amp;lt;SalesDate={"&amp;gt;=$(=date&lt;/SPAN&gt;&lt;STRONG style="background-color: #ffffff; font-size: 12px; font-family: Arial; background-position: initial; color: #ff0000;"&gt;#&lt;/STRONG&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;('2012/03/06','YYYY/MM/DD')&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; font-size: 12px; font-family: Arial; background-position: initial; color: #ff0000;"&gt;&lt;STRONG style="background-position: initial;"&gt;+0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;)"}&amp;gt;}SalesQty) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;works correct, but when I replace &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;'2012/03/06' for &lt;/SPAN&gt;&lt;/SPAN&gt;max(RequestDate) &lt;SPAN style="text-decoration: underline;"&gt;and I put it inside a straight-table &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then the expression stays like :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;SalesDate={"&amp;gt;=$(=date#(max(RequestDate),'YYYY/MM/DD')+0)"}&amp;gt;}SalesQty)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it just doesn't work....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2012 10:10:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis-not-working/m-p/367884#M136818</guid>
      <dc:creator>cafcptg2011</dc:creator>
      <dc:date>2012-03-27T10:10:28Z</dc:date>
    </item>
  </channel>
</rss>

