<?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: Expression error in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-error/m-p/1111896#M892362</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt;&amp;gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;01. NUM#(TODAY(DATE#(1))-DATE#(&lt;STRONG&gt;DATE&lt;/STRONG&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is both a logical error as well as a naked field* (bold) in this expression. The logic should be as Marcus outlined above, but that does not solve the naked field. It &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;is not clear what you want to with the total for this expression.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;gt;&amp;gt;02. SUM(IF(STATUS='ACTIVE',((LOAN_AMOUNT*(RATE/22.54))-(TODAY(DATE#(1))-DATE#(DATE))),((INS_AMT*NO_INS)-LOAN_AMOUNT)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Let's rewrite this in a way that is more readable, and fix the incorrect use of Today():&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SUM(IF(STATUS='ACTIVE', &lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAN_AMOUNT * RATE / 22.54 - (TODAY() - DATE#(DATE)), &lt;/P&gt;&lt;P&gt;&amp;nbsp; INS_AMT * NO_INS - LOAN_AMOUNT))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But that looks logically wrong as well - you are subtracting a number of days from a value (&lt;SPAN style="font-size: 13.3333330154419px;"&gt;LOAN_AMOUNT * RATE), which does not look correct - do you not mean to divide?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;*Naked field is a reference to a field not inside an aggregation function like Sum(), Count(), Max() etc. This field will only return a value if there is only one possible value at that point - which is not true for the totals.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Aug 2016 06:31:24 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2016-08-16T06:31:24Z</dc:date>
    <item>
      <title>Expression error</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-error/m-p/1111891#M892355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have following 2 expressions which are not working properly,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;01. NUM#(TODAY(DATE#(1))-DATE#(DATE))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sub total is not working for this expression let me know the mistake made by me.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;02. SUM(IF(STATUS='ACTIVE',&lt;STRONG style=": ; color: #575757; text-decoration: underline;"&gt;((LOAN_AMOUNT*(RATE/22.54))-(TODAY(DATE#(1))-DATE#(DATE)))&lt;/STRONG&gt;,((INS_AMT*NO_INS)-LOAN_AMOUNT)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Under lined part of the expression is not working. when i test only this part it's working.&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thks &amp;amp; Rgds,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Priyantha.&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/Expression-error/m-p/1111891#M892355</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Expression error</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-error/m-p/1111892#M892356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NUM(TODAY()-DATE(DATE))&lt;/P&gt;&lt;P&gt;or if DATE isn't interpreted as date&lt;/P&gt;&lt;P&gt;NUM(TODAY()-DATE(DATE#(DATE), 'YourFormatPattern'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and of course the same logic within the second expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2016 05:38:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-error/m-p/1111892#M892356</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-08-16T05:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Expression error</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-error/m-p/1111893#M892357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks lot for early answer, But same error still available,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thkx &amp;amp; Rgds,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Priyantha,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2016 06:08:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-error/m-p/1111893#M892357</guid>
      <dc:creator />
      <dc:date>2016-08-16T06:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Expression error</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-error/m-p/1111894#M892358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How looked DATE - values and formattings?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2016 06:11:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-error/m-p/1111894#M892358</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-08-16T06:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: Expression error</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-error/m-p/1111895#M892360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to take the no. of days (Value) between two days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Priyantha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2016 06:17:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-error/m-p/1111895#M892360</guid>
      <dc:creator />
      <dc:date>2016-08-16T06:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: Expression error</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-error/m-p/1111896#M892362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt;&amp;gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;01. NUM#(TODAY(DATE#(1))-DATE#(&lt;STRONG&gt;DATE&lt;/STRONG&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is both a logical error as well as a naked field* (bold) in this expression. The logic should be as Marcus outlined above, but that does not solve the naked field. It &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;is not clear what you want to with the total for this expression.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;gt;&amp;gt;02. SUM(IF(STATUS='ACTIVE',((LOAN_AMOUNT*(RATE/22.54))-(TODAY(DATE#(1))-DATE#(DATE))),((INS_AMT*NO_INS)-LOAN_AMOUNT)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Let's rewrite this in a way that is more readable, and fix the incorrect use of Today():&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SUM(IF(STATUS='ACTIVE', &lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAN_AMOUNT * RATE / 22.54 - (TODAY() - DATE#(DATE)), &lt;/P&gt;&lt;P&gt;&amp;nbsp; INS_AMT * NO_INS - LOAN_AMOUNT))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But that looks logically wrong as well - you are subtracting a number of days from a value (&lt;SPAN style="font-size: 13.3333330154419px;"&gt;LOAN_AMOUNT * RATE), which does not look correct - do you not mean to divide?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;*Naked field is a reference to a field not inside an aggregation function like Sum(), Count(), Max() etc. This field will only return a value if there is only one possible value at that point - which is not true for the totals.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2016 06:31:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-error/m-p/1111896#M892362</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2016-08-16T06:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Expression error</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-error/m-p/1111897#M892364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the early reply,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to calculate the loan interest for the number of days between today and the Started day(DATE). Rate should be divided from 22.54 to achieve the daily basis interest rate. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this simple logic available to calculate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If( Status= 'ACTIVE', &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If above logic is true,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;1. loan_amount*Daily Rate* no.of days,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other wise,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. (Installment* no. of installment)-loan_amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is no.of days calculation is not working with the logic as i understood. As i have tested the same without logic it is working as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnx &amp;amp; Rgds,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Priyantha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2016 07:26:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-error/m-p/1111897#M892364</guid>
      <dc:creator />
      <dc:date>2016-08-16T07:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: Expression error</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-error/m-p/1111898#M892366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the problem is that DATE isn't unique defined and you need something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NUM(TODAY()-&lt;STRONG&gt;max&lt;/STRONG&gt;(DATE))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which then needs to be wrapped with an aggr because it would be inside from the sum-function (no nested aggregation without an aggr-function) whereby it might be easier to outsource these calculation into a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2016 08:19:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-error/m-p/1111898#M892366</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-08-16T08:19:10Z</dc:date>
    </item>
  </channel>
</rss>

