<?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 Scripting flaw? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Scripting-flaw/m-p/244165#M708510</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gilles and Oleg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first I tried your approach Gilles. Sadly, it didn't work :-(.&lt;/P&gt;&lt;P&gt;Then I tried your approach Oleg... And it worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all for helping me out, and Oleg, thanks for finding the correct answer to the problem!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Sep 2011 06:15:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-09-08T06:15:30Z</dc:date>
    <item>
      <title>Scripting flaw?</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-flaw/m-p/244158#M708503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to the forum and I have just completed a course on Qlikview (Developer and Designer I and II).&lt;/P&gt;&lt;P&gt;The following problem occurs when I am trying to write a script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have loaded the data from our SAP-system into some qvd-files.&lt;/P&gt;&lt;P&gt;From these qvd-files, I have loaded all the data from one table.&lt;/P&gt;&lt;P&gt;The data exists, among other things, from the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Gross external sales],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Gross internal sales],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Rebates external], &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Discount,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to edit this a little bit to make it easier to handle, so I did the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Gross external sales] as GrossSales,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Gross internal sales] as ICSales,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Rebates external] as Rebates, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Discount as Discounts,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Gross internal sales] + [Gross external sales] + [Rebates external] as NetSales,&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first 4 lines don't give any problems, they show the data they should at the front end table.&lt;/P&gt;&lt;P&gt;The fifth line however gives as outcome '0' on my front end, whilst line 1, 2 and 3 definitely contain data.&lt;/P&gt;&lt;P&gt;The problem seems to lie within the 'Gross internal sales' part, because when I remove that one, the outcome is indeed the 'Gross external sales' + the 'Rebates external'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any idea what this could be?&lt;/P&gt;&lt;P&gt;Much appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2011 13:17:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-flaw/m-p/244158#M708503</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-09-07T13:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting flaw?</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-flaw/m-p/244159#M708504</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;Try this &lt;/P&gt;&lt;P&gt;[tblName]:&lt;BR /&gt;LOAD *,&lt;BR /&gt;GrossSales + ICSales + Rebates AS NetSales;&lt;BR /&gt;LOAD&lt;BR /&gt;[Gross external sales] as GrossSales,&lt;BR /&gt;[Gross internal sales] as ICSales,&lt;BR /&gt;[Rebates external] as Rebates, &lt;BR /&gt;Discount as Discounts&lt;BR /&gt;FROM TableName;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2011 13:39:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-flaw/m-p/244159#M708504</guid>
      <dc:creator>Sokkorn</dc:creator>
      <dc:date>2011-09-07T13:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting flaw?</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-flaw/m-p/244160#M708505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sokkorn,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first, thanks for the help :-).&lt;/P&gt;&lt;P&gt;On topic: how should it look?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My script now looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;LOAD &lt;BR /&gt;&amp;nbsp; // Keyfields&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %MaterialNumber_Key, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %Customer_Key, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Sourcefields&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Gross external sales] as GrossSales,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Gross internal sales] as ICSales,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Rebates external] as Rebates,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Discount as Discounts,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Gross external sales] + [Gross internal sales] + [Rebates external] as NetSales,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year_Billing, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Quarter_Billing,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month_Billing,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Week_Billing, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Day_Billing, &lt;/P&gt;&lt;P&gt;FROM&lt;BR /&gt;[CE11000_COPA LineItems_P60.qvd]&lt;BR /&gt;(qvd); &lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Now how should it look? Don't know where you want me to put the extra table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2011 13:59:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-flaw/m-p/244160#M708505</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-09-07T13:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting flaw?</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-flaw/m-p/244161#M708506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try below script&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;[TableName]:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;GrossSales + ICSales + Rebates AS NetSales;&lt;/P&gt;&lt;P&gt;LOAD 
&amp;nbsp; // Keyfields
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %MaterialNumber_Key, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %Customer_Key, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Sourcefields
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Gross external sales] as GrossSales,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Gross internal sales] as ICSales,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Rebates external] as Rebates,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Discount as Discounts,
&amp;nbsp;&amp;nbsp; //&amp;nbsp; [Gross external sales] + [Gross internal sales] + [Rebates external] as NetSales,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year_Billing, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Quarter_Billing,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month_Billing,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Week_Billing, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Day_Billing, 
FROM
[CE11000_COPA LineItems_P60.qvd]
(qvd); 
&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;Let me know if this one help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2011 14:04:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-flaw/m-p/244161#M708506</guid>
      <dc:creator>Sokkorn</dc:creator>
      <dc:date>2011-09-07T14:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting flaw?</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-flaw/m-p/244162#M708507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hello Sokkorn,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sadly, this doesn't work :-(.&lt;/P&gt;&lt;P&gt;When I try the same for my Freight Costs or my Costs RAW, the same problem occurs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;[Freight costs internal] + [Freight costs external] as FreightCosts,&lt;BR /&gt;[Costs RAW internal] - [Costs RAW external] as Materials,&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These also give a '0' on my front end.&lt;/P&gt;&lt;P&gt;When I name the internal and the external positions seperate in my script, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;[Freight costs internal]&lt;/P&gt;&lt;P&gt;[Freight costs external]&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and add the together in my expression in my front end like this: "&lt;EM&gt;(sum([Freight costs internal])+sum([Freight costs external]))"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;it does give the good value. This however I wanted to minimize, since that costs a lot of memory...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2011 14:23:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-flaw/m-p/244162#M708507</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-09-07T14:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting flaw?</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-flaw/m-p/244163#M708508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it may come from the data itself. Is column [Gross internal sales] same format in sap as others ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;num&lt;/STRONG&gt;([Gross internal sales]) + [Gross external sales] + [Rebates external] as NetSales,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gilles&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2011 15:44:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-flaw/m-p/244163#M708508</guid>
      <dc:creator />
      <dc:date>2011-09-07T15:44:28Z</dc:date>
    </item>
    <item>
      <title>Scripting flaw?</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-flaw/m-p/244164#M708509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Most likely, some of those three numbers have a null() value. Any arithmetical operation with null() will always return null() as a result. Try enclosing your fields in a RANGESUM function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 18px;"&gt;RANGESUM&lt;/STRONG&gt;([Gross internal sales]),&amp;nbsp; [Gross external sales], [Rebates external]) as NetSales,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice that '+' needs to be replaced with commas. Rangesum() takes care of the nulls by padding them with zeros.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oleg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2011 16:52:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-flaw/m-p/244164#M708509</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2011-09-07T16:52:44Z</dc:date>
    </item>
    <item>
      <title>Scripting flaw?</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-flaw/m-p/244165#M708510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gilles and Oleg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first I tried your approach Gilles. Sadly, it didn't work :-(.&lt;/P&gt;&lt;P&gt;Then I tried your approach Oleg... And it worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all for helping me out, and Oleg, thanks for finding the correct answer to the problem!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Sep 2011 06:15:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-flaw/m-p/244165#M708510</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-09-08T06:15:30Z</dc:date>
    </item>
    <item>
      <title>Scripting flaw?</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-flaw/m-p/244166#M708511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Following expression will also work &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 18px;"&gt;Num(Trim(&lt;/STRONG&gt;[Gross internal sales])))+ Num(Trim( [Gross external sales]))+ Num(Trim([Rebates external]))) as NetSales,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Sep 2011 06:34:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-flaw/m-p/244166#M708511</guid>
      <dc:creator>suniljain</dc:creator>
      <dc:date>2011-09-08T06:34:43Z</dc:date>
    </item>
  </channel>
</rss>

