<?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 Script Expression Error in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Script-Expression-Error/m-p/189410#M52310</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Raj.&lt;/P&gt;&lt;P&gt;Your Formula worked. It was on my side. I wrote 'On Time' instead of 'On-Time'. My bad &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Correct formula is this:&lt;/P&gt;&lt;P&gt;=num(COUNT(DISTINCT If( ShipmentStatus = 'On-Time', PurchaseOrderNumber ))/COUNT( DISTINCT PurchaseOrderNumber),'##,0%')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for the help guys.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Sep 2010 12:34:47 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-09-06T12:34:47Z</dc:date>
    <item>
      <title>Script Expression Error</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Expression-Error/m-p/189403#M52303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys.&lt;/P&gt;&lt;P&gt;Im trying to find the on tme shipping % can anyone help me? this is my formula in script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(ShipDate-DueDate&amp;lt;=0,'On-Time','Late') as ShipmentStatus,&lt;/P&gt;&lt;P&gt;num(count(if(ShipDate-DueDate&amp;lt;=0,'On-Time','Late')'On-Time',/if(ShipDate-DueDate&amp;lt;=0,'On-Time','Late')'Late'),'#0%') as OnTime%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And this is the error:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="error loading image" class="jive-image error-loading-image" src="https://community.qlik.com/legacyfs/online/-2306_sourceID:2306" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Sep 2010 10:51:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Expression-Error/m-p/189403#M52303</guid>
      <dc:creator />
      <dc:date>2010-09-06T10:51:06Z</dc:date>
    </item>
    <item>
      <title>Script Expression Error</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Expression-Error/m-p/189404#M52304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;anyone?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Sep 2010 12:03:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Expression-Error/m-p/189404#M52304</guid>
      <dc:creator />
      <dc:date>2010-09-06T12:03:51Z</dc:date>
    </item>
    <item>
      <title>Script Expression Error</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Expression-Error/m-p/189405#M52305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Blaze,&lt;/P&gt;&lt;P&gt;You could try use : count( {$&amp;lt;ShipmentStatus = {"On-Time"}&amp;gt;} value ) for the On-Time Count&lt;/P&gt;&lt;P&gt;Then another expression for Late : count( {$&amp;lt;ShipmentStatus = {"Late"}&amp;gt;} value )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Sep 2010 12:05:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Expression-Error/m-p/189405#M52305</guid>
      <dc:creator />
      <dc:date>2010-09-06T12:05:35Z</dc:date>
    </item>
    <item>
      <title>Script Expression Error</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Expression-Error/m-p/189406#M52306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Xena.&lt;/P&gt;&lt;P&gt;Thanks for the reply. I tried :&lt;/P&gt;&lt;P&gt;=count( {$&amp;lt;ShipmentStatus = {"On-Time"}&amp;gt;})/count( {$&amp;lt;ShipmentStatus = {'Late'}&amp;gt;})&lt;/P&gt;&lt;P&gt;but it doesn't work.I need to take the total shipments made, whether they were late or not, and then divide by the number of late shipments to work out the On-time %. It also needs to be done in the script. Have u maybe got any other ideas? Thanks so much for your help i really appreciate it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Sep 2010 12:24:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Expression-Error/m-p/189406#M52306</guid>
      <dc:creator />
      <dc:date>2010-09-06T12:24:34Z</dc:date>
    </item>
    <item>
      <title>Script Expression Error</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Expression-Error/m-p/189407#M52307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Blaze,&lt;/P&gt;&lt;P&gt;Let us say you want to calculate the OnTime Shipment %. You have some fields InvNo, InvDt, ShipDate, DueDate, InvAmount, InvQty.&lt;/P&gt;&lt;P&gt;INVOICE_DETAILS:&lt;/P&gt;&lt;P&gt;LOAD CustomerCode,&lt;/P&gt;&lt;P&gt;InvNo,&lt;/P&gt;&lt;P&gt;InvDt,&lt;/P&gt;&lt;P&gt;ShipDate,&lt;/P&gt;&lt;P&gt;DueDate,&lt;/P&gt;&lt;P&gt;InvAmount,&lt;/P&gt;&lt;P&gt;InvQty,&lt;/P&gt;&lt;P&gt;If( ShipDate - DueDate &amp;lt;= 0,'On Time', 'Late') AS ShipStatus&lt;/P&gt;&lt;P&gt;FROM INVOICE_DETAILS.xls;&lt;/P&gt;&lt;P&gt;In the graphs (front end), you can write the expressions&lt;/P&gt;&lt;P&gt;= COUNT(DISTINCT If( ShipStatus = 'On Time', InvNo )) / COUNT( DISTINCT InvNo)&lt;/P&gt;&lt;P&gt;Let us say that you have 100 invoices out of which 60 was delievered on time and 40 was late delievery.&lt;/P&gt;&lt;P&gt;This expression will give you 60%.&lt;/P&gt;&lt;P&gt;Hope, it would helpful for you.&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Raj Kishor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Sep 2010 12:26:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Expression-Error/m-p/189407#M52307</guid>
      <dc:creator />
      <dc:date>2010-09-06T12:26:16Z</dc:date>
    </item>
    <item>
      <title>Script Expression Error</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Expression-Error/m-p/189408#M52308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can add this small bit into your script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Sep 2010 12:29:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Expression-Error/m-p/189408#M52308</guid>
      <dc:creator />
      <dc:date>2010-09-06T12:29:04Z</dc:date>
    </item>
    <item>
      <title>Script Expression Error</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Expression-Error/m-p/189409#M52309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Raj.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply. I understand what you mean about the Invno, etc. I used this:&lt;/P&gt;&lt;P&gt;= COUNT(DISTINCT If( ShipmentStatus = 'On Time', PurchaseOrderNumber )) / COUNT( DISTINCT PurchaseOrderNumber)&lt;/P&gt;&lt;P&gt;Where PurchaseOrderNumber was the Order number and it still gives me -?&lt;/P&gt;&lt;P&gt;Any Ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Sep 2010 12:30:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Expression-Error/m-p/189409#M52309</guid>
      <dc:creator />
      <dc:date>2010-09-06T12:30:15Z</dc:date>
    </item>
    <item>
      <title>Script Expression Error</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Expression-Error/m-p/189410#M52310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Raj.&lt;/P&gt;&lt;P&gt;Your Formula worked. It was on my side. I wrote 'On Time' instead of 'On-Time'. My bad &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Correct formula is this:&lt;/P&gt;&lt;P&gt;=num(COUNT(DISTINCT If( ShipmentStatus = 'On-Time', PurchaseOrderNumber ))/COUNT( DISTINCT PurchaseOrderNumber),'##,0%')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for the help guys.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Sep 2010 12:34:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Expression-Error/m-p/189410#M52310</guid>
      <dc:creator />
      <dc:date>2010-09-06T12:34:47Z</dc:date>
    </item>
  </channel>
</rss>

