<?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: problem with sum expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/problem-with-sum-expression/m-p/1317430#M832811</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;whether the last closing braces required&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Jun 2017 12:35:42 GMT</pubDate>
    <dc:creator>tajmohamed30</dc:creator>
    <dc:date>2017-06-06T12:35:42Z</dc:date>
    <item>
      <title>problem with sum expression</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-sum-expression/m-p/1317428#M832809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My name is Christian and I have a problem with an QlikView expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MySQL condition:&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; START_DATE BETWEEN selDateFrom AND selDateTo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND EXISTS(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT &lt;SPAN style="font-size: 10pt;"&gt;SUBSCRIPTION_ID&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t_payment pay&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pay.SUBSCRIPTION_ID = sub.SUBSCRIPTION_ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND OPERATOR_ID IN(I_OPERATOR)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND DATE(pay.TIME_STAMP) = DATE(sub.START_DATE)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND pay.PRICE &amp;gt; 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My QlikView expression:&lt;/P&gt;&lt;P&gt;sum(if(START_DATE_FORMAT &amp;gt;=V_Start_date and START_DATE_FORMAT &amp;lt;V_End_date and sum(if(SUBSCRIPTION_ID=PAYMENT_SUBSCRIPTION_ID and PAY.TIME_STAMP_FORMAT=START_DATE_FORMAT and PRICE&amp;gt;0,1,0))&amp;gt;0,1,0)) but it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help me please?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Christian&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/problem-with-sum-expression/m-p/1317428#M832809</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sum expression</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-sum-expression/m-p/1317429#M832810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What are you trying to SUM?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But The syntax for nested if is as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Logical test and/or Logitical test,value if true,if(next logical test and/or another test,value if true,if(3rd logical test,value if true,value if false)))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using your fields above.&amp;nbsp; Something like the below should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF(START_DATE_FORMAT&amp;gt;=V_Start_date AND START_DATE_FORMAT &amp;lt; V_End_date,1,if(SUBSCRIPTION_ID=PAYMENT_SUBSCRIPTION_ID AND PAY.TIME_STAMP_FORMAT=START_DATE_FORMAT AND PRICE&amp;gt;0,1,0)))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jun 2017 12:16:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-sum-expression/m-p/1317429#M832810</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-06T12:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sum expression</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-sum-expression/m-p/1317430#M832811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;whether the last closing braces required&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jun 2017 12:35:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-sum-expression/m-p/1317430#M832811</guid>
      <dc:creator>tajmohamed30</dc:creator>
      <dc:date>2017-06-06T12:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sum expression</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-sum-expression/m-p/1317431#M832812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It might need more brackets, just check, while typing the expression, if one of the first brackets are red, it means more are needed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jun 2017 12:36:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-sum-expression/m-p/1317431#M832812</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-06T12:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sum expression</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-sum-expression/m-p/1317432#M832813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it is important to count this type of record, but the result is '-'. &lt;/P&gt;&lt;P&gt;In my expression there aren't red brackets.&lt;/P&gt;&lt;P&gt;It is a big condition and the last part is a "SQL exists" &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jun 2017 12:48:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-sum-expression/m-p/1317432#M832813</guid>
      <dc:creator />
      <dc:date>2017-06-06T12:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sum expression</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-sum-expression/m-p/1317433#M832814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Hi Christian,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Why don't you do the same SQL where clause in the QV script?&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;And then create the flag and in the front end just sum the flag.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Something like this:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;TableName:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Load Field1,Field2, FieldN, 1 as _FlagName;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;SQL SELECT *&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;FROM source&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;WHERE&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; START_DATE BETWEEN selDateFrom AND selDateTo&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND EXISTS(SELECT &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;SUBSCRIPTION_ID&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM&amp;nbsp; t_payment pay&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;WHERE&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pay.SUBSCRIPTION_ID = sub.SUBSCRIPTION_ID&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND OPERATOR_ID IN(I_OPERATOR)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND DATE(pay.TIME_STAMP) = DATE(sub.START_DATE)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND pay.PRICE &amp;gt; 0)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Or you can translate the SQL condition and use it in QV script.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Hope that helps.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Thanks,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Carlos M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jun 2017 14:15:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-sum-expression/m-p/1317433#M832814</guid>
      <dc:creator>CarlosAMonroy</dc:creator>
      <dc:date>2017-06-06T14:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sum expression</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-sum-expression/m-p/1317434#M832815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes but i prefer to use an expression in my report. I think that I have a sintax error. Other solution?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jun 2017 15:15:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-sum-expression/m-p/1317434#M832815</guid>
      <dc:creator />
      <dc:date>2017-06-06T15:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sum expression</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-sum-expression/m-p/1317435#M832816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you can share a qvw example would be great. anyways the If's conditions that you are using are not correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should try something like:&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;sum(if(START_DATE_FORMAT &amp;gt;= V_Start_date and START_DATE_FORMAT &amp;lt; V_End_date)&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; and SUBSCRIPTION_ID=PAYMENT_SUBSCRIPTION_ID&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;and PAY.TIME_STAMP_FORMAT=START_DATE_FORMAT&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;and PRICE&amp;gt;0,1,0))&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;Hope that helps,&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;Carlos M&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jun 2017 15:39:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-sum-expression/m-p/1317435#M832816</guid>
      <dc:creator>CarlosAMonroy</dc:creator>
      <dc:date>2017-06-06T15:39:53Z</dc:date>
    </item>
  </channel>
</rss>

