<?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: What is wrong with my equation? or set analysis? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656297#M474793</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;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;count(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff; background-color: #f6f6f6;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff; background-color: #f6f6f6;"&gt;num&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000; background-color: #f6f6f6;"&gt;SERVICE_ACT_TERM_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000; background-color: #f6f6f6;"&gt;SERVICE_DATE_START&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;) &amp;lt;=7,&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000; background-color: #f6f6f6;"&gt;PERSONID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;The above expression works when there are both fields in the chart, what if the fields are not there in the chart?&amp;nbsp; The one we proposed is the best and efficient approach calculating in front end is not a good approach.&amp;nbsp;&amp;nbsp; I think there is some issue with date formats that is why you are not get this done in script.&amp;nbsp; Try to avoid calculations in front end so that in future you won't get performance issues.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;Please close this thread so that it would be helpful for those who are looking for similar solution.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;Jagan.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Aug 2014 02:00:25 GMT</pubDate>
    <dc:creator>jagan</dc:creator>
    <dc:date>2014-08-28T02:00:25Z</dc:date>
    <item>
      <title>What is wrong with my equation? or set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656288#M474784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;I need to get a nuber of days between two dates and compare it if it greater than 0 and less or equal to 7.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;So, I have come up with the equation below, but it said "error in set modifier expression." &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;what is wrong with that?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Count({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Num&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SERVICE_ACT_TERM_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SERVICE_DATE_START&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)={&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"&amp;gt;0&amp;lt;=7"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;}PERSONID) &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 22:59:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656288#M474784</guid>
      <dc:creator />
      <dc:date>2014-08-26T22:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with my equation? or set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656289#M474785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot use an expression like this in set analysis.&amp;nbsp; It must be a field.&amp;nbsp; If you want to use set analysis, you need to create this difference as a separate field in the script:&lt;BR /&gt;num(SERVICE_ACT_TERM_DATE - SERVICE_DATE_START)as NewField&lt;BR /&gt;So you can try this:&lt;BR /&gt;Count({&amp;lt;&lt;STRONG&gt;NewField&lt;/STRONG&gt;={"&amp;gt;=&amp;lt;=7"}&amp;gt;} PERSONID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or maybe just don't use set analysis but an expression with "if"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 23:15:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656289#M474785</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-26T23:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with my equation? or set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656290#M474786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "Service_ACT_TERM_Date" and "Service_DATE_START" are coming from sql server. Therefore, I cannot change any of it including the creation of new field. Or can I?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I just type in below in Script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num(SERVICE_ACT_TERM_DATE - SERVICE_DATE_START)as NewField&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 23:46:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656290#M474786</guid>
      <dc:creator />
      <dc:date>2014-08-26T23:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with my equation? or set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656291#M474787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, it is typical to get the data from a database, but it doesn't mean that you're restricted.&amp;nbsp; Use&lt;STRONG&gt; preceding load&lt;/STRONG&gt;, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field1,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field2,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;any valid QlikView function&amp;gt; as [Another Field],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field1,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;FROM &amp;lt;your database table&amp;gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 01:20:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656291#M474787</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-27T01:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with my equation? or set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656292#M474788</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;It is easier in front end if you deal this in backend script, because everywhere you don't need to do the same calculation.&amp;nbsp; Also the performance of the app is also good if calculations are done in script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Data:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Num(SERVICE_ACT_TERM_DATE - SERVICE_DATE_START) &amp;gt; 0 AND &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: #3d3d3d; font-style: inherit; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Num(SERVICE_ACT_TERM_DATE - SERVICE_DATE_START) &amp;lt;= 7, 1, 0) AS Flag&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SQL SELECT&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM &amp;lt;your database table&amp;gt;;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Now in front end you can just use below expression&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Count({&amp;lt;&lt;STRONG style="color: #3d3d3d; font-family: inherit; font-style: inherit;"&gt;&lt;STRONG style="color: #3d3d3d; font-style: inherit; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Flag&lt;/STRONG&gt;&lt;/STRONG&gt;={1}&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;gt;}PERSONID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hope this helps you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Jagan.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 01:35:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656292#M474788</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2014-08-27T01:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with my equation? or set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656293#M474789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I added and&amp;nbsp; tried&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SERVICE_ACT_TERM_DATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SERVICE_DATE_START,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SERVICE_ACT_TERM_DATE-SERVICE_DATE_START&amp;gt; as newfield&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SERVICE_ACT_TERM_DATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SERVICE_DATE_START,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------------------------------------------- and&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SERVICE_ACT_TERM_DATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SERVICE_DATE_START,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; num(SERVICE_ACT_TERM_DATE-SERVICE_DATE_START) as newfield&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SERVICE_ACT_TERM_DATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SERVICE_DATE_START,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;FROM data base,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But none of them are working&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 13:41:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656293#M474789</guid>
      <dc:creator />
      <dc:date>2014-08-27T13:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with my equation? or set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656294#M474790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd use:&lt;/P&gt;&lt;P&gt;SERVICE_ACT_TERM_DATE - SERVICE_DATE_START as newfield&lt;/P&gt;&lt;P&gt;What is the format of the fields?&amp;nbsp; Maybe they are not real date/time fields and need some formatting?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you make it to work, I recommend to use "Flag" approach per &lt;A href="https://community.qlik.com/qlik-users/23109"&gt;Jagan Mohan&lt;/A&gt; - it makes expression simpler.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 13:51:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656294#M474790</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-27T13:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with my equation? or set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656295#M474791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To all,&lt;/P&gt;&lt;P&gt;No one got the right answer. And, yes, I can use the expression like that.&lt;/P&gt;&lt;P&gt;Only things that I needed were if stament with num. It worked without having the complecated way as below. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;count(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;num&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SERVICE_ACT_TERM_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SERVICE_DATE_START&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt;=7,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PERSONID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Thank you for replies. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 19:37:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656295#M474791</guid>
      <dc:creator />
      <dc:date>2014-08-27T19:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with my equation? or set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656296#M474792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I didn't mean you guys were wrong.&lt;/P&gt;&lt;P&gt;I meant it was not a 'simpler way,' which is easy for new users, like me, to understand.&lt;/P&gt;&lt;P&gt;I learned something from you guys. And I really appreciate that.&lt;/P&gt;&lt;P&gt;Thank you again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 19:52:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656296#M474792</guid>
      <dc:creator />
      <dc:date>2014-08-27T19:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with my equation? or set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656297#M474793</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;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;count(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff; background-color: #f6f6f6;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff; background-color: #f6f6f6;"&gt;num&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000; background-color: #f6f6f6;"&gt;SERVICE_ACT_TERM_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000; background-color: #f6f6f6;"&gt;SERVICE_DATE_START&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;) &amp;lt;=7,&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000; background-color: #f6f6f6;"&gt;PERSONID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;The above expression works when there are both fields in the chart, what if the fields are not there in the chart?&amp;nbsp; The one we proposed is the best and efficient approach calculating in front end is not a good approach.&amp;nbsp;&amp;nbsp; I think there is some issue with date formats that is why you are not get this done in script.&amp;nbsp; Try to avoid calculations in front end so that in future you won't get performance issues.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;Please close this thread so that it would be helpful for those who are looking for similar solution.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;Jagan.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Aug 2014 02:00:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656297#M474793</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2014-08-28T02:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with my equation? or set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656298#M474794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Jagan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to delete or close this thread as you requested. However, it comes out that I am not authorized to delete this post. How can I close it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 19:22:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656298#M474794</guid>
      <dc:creator />
      <dc:date>2014-09-18T19:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with my equation? or set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656299#M474795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mark the most useful answer as "Correct" &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 00:20:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656299#M474795</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-19T00:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: What is wrong with my equation? or set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656300#M474796</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;AS &lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;A href="https://community.qlik.com/people/msolomov"&gt;msolomov&lt;/A&gt;&lt;/STRONG&gt; suggested please give correct answer to the most useful post which helps you in getting the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 01:19:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-wrong-with-my-equation-or-set-analysis/m-p/656300#M474796</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2014-09-19T01:19:54Z</dc:date>
    </item>
  </channel>
</rss>

