<?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: Adding credits and debits from same field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Adding-credits-and-debits-from-same-field/m-p/327178#M120419</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you can simply add an IF statement inside your Sum expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Credit: &lt;/STRONG&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;sum(if([Actual Cost]&amp;lt;0,[Actual Cost],0))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Debit:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;sum(if([Actual Cost]&amp;gt;0,[Actual Cost],0))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See attached example,&lt;/P&gt;&lt;P&gt;Ingo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Feb 2012 02:18:24 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-02-29T02:18:24Z</dc:date>
    <item>
      <title>Adding credits and debits from same field</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-credits-and-debits-from-same-field/m-p/327177#M120418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Anyone know how to add the credits and debits from the same field to end up with two different totals? The example is attached in excel format.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 02:00:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-credits-and-debits-from-same-field/m-p/327177#M120418</guid>
      <dc:creator />
      <dc:date>2012-02-29T02:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Adding credits and debits from same field</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-credits-and-debits-from-same-field/m-p/327178#M120419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you can simply add an IF statement inside your Sum expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Credit: &lt;/STRONG&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;sum(if([Actual Cost]&amp;lt;0,[Actual Cost],0))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Debit:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;sum(if([Actual Cost]&amp;gt;0,[Actual Cost],0))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See attached example,&lt;/P&gt;&lt;P&gt;Ingo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 02:18:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-credits-and-debits-from-same-field/m-p/327178#M120419</guid>
      <dc:creator />
      <dc:date>2012-02-29T02:18:24Z</dc:date>
    </item>
    <item>
      <title>Adding credits and debits from same field</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-credits-and-debits-from-same-field/m-p/327179#M120420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi,&lt;/P&gt;&lt;P&gt;For financial calculation it is better to create Credit and Debit fields in Script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;ExpenseLine,&lt;/P&gt;&lt;P&gt;If(Amount&amp;gt;=,0,Amount,0) as Debit,&lt;/P&gt;&lt;P&gt;If(Amount&amp;lt;0,Amount,0) as Credit&lt;/P&gt;&lt;P&gt;From Table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you can use &lt;/P&gt;&lt;P&gt;Sum(Debit) and Sum(Credit) in chart&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this will help.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 06:32:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-credits-and-debits-from-same-field/m-p/327179#M120420</guid>
      <dc:creator>vijay_iitkgp</dc:creator>
      <dc:date>2012-02-29T06:32:43Z</dc:date>
    </item>
    <item>
      <title>Adding credits and debits from same field</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-credits-and-debits-from-same-field/m-p/327180#M120421</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;You can arrive a flag for Credit and Debit in script as suggested by Vijay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TableName:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;ExpenseLine,&lt;/P&gt;&lt;P&gt;If(Amount&amp;gt;=,0,Amount,0) as Debit,&lt;/P&gt;&lt;P&gt;If(Amount&amp;lt;0,Amount,0) as Credit&lt;/P&gt;&lt;P&gt;From Table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you can use &lt;/P&gt;&lt;P&gt;Sum(Debit) and Sum(Credit) in chart&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't want to arrive a flag in script then use the following expressions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Credit:&lt;/P&gt;&lt;P&gt;=Sum({&amp;lt;&lt;CODE class="jive-code"&gt;[Actual Cost]={'&amp;lt;0'}&amp;gt;} &lt;/CODE&gt;&lt;CODE class="jive-code"&gt;[Actual Cost])&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Debit:&lt;/P&gt;&lt;P&gt;=Sum({&amp;lt;&lt;CODE class="jive-code"&gt;[Actual Cost]={'&amp;lt;0'}&amp;gt;} &lt;/CODE&gt;&lt;CODE class="jive-code"&gt;[Actual Cost])&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best way to do this is arriving the flag for Debit and Credit in Script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&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>Wed, 29 Feb 2012 06:39:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-credits-and-debits-from-same-field/m-p/327180#M120421</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2012-02-29T06:39:45Z</dc:date>
    </item>
    <item>
      <title>Adding credits and debits from same field</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-credits-and-debits-from-same-field/m-p/327181#M120422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try with this&lt;/P&gt;&lt;P&gt;TableName:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;ExpenseLine,&lt;/P&gt;&lt;P&gt;If(Amount&amp;gt;=,0,Amount) as Debit,&lt;/P&gt;&lt;P&gt;If(Amount&amp;lt;0,Amount) as Credit&lt;/P&gt;&lt;P&gt;From Datasource;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you can use&lt;/P&gt;&lt;P&gt;Sum(Debit) and Sum(Credit) in chart&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the best one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Celambarasan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 06:50:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-credits-and-debits-from-same-field/m-p/327181#M120422</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2012-02-29T06:50:21Z</dc:date>
    </item>
    <item>
      <title>Adding credits and debits from same field</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-credits-and-debits-from-same-field/m-p/327182#M120423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thank you all for your suggestions, I was able to create what I need with your input! Venus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 19:29:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-credits-and-debits-from-same-field/m-p/327182#M120423</guid>
      <dc:creator />
      <dc:date>2012-02-29T19:29:47Z</dc:date>
    </item>
  </channel>
</rss>

