<?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: Calculated field with conditional in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289308#M868217</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I understand, I didn't know how does it work exactly. Thank you for your hints Vineeth.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Dec 2016 14:10:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-12-06T14:10:32Z</dc:date>
    <item>
      <title>Calculated field with conditional</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289301#M868210</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;I have two columns in my table - category and value. I would like to add in data load editor calculated fields that derives from the category filed:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Category='Sales',Amount,0)-If(Category='Costs',Amount,0) as Profit. It gives me strange data, I don't know what's wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maciek&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/Calculated-field-with-conditional/m-p/1289301#M868210</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated field with conditional</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289302#M868211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you show how does your raw data looks like and what you are getting?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 13:33:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289302#M868211</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-06T13:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated field with conditional</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289303#M868212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use the below in your chart&lt;/P&gt;&lt;P&gt;sum({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Category={'Sales'}&lt;/SPAN&gt;&amp;gt;}Amount) - &lt;SPAN style="font-size: 13.3333px;"&gt;sum({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Category={'Cost'}&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;gt;}Amount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if one data row has only one category how will your if statement evaluate per row? Just think!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will always be Amount for each row .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 13:35:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289303#M868212</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2016-12-06T13:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated field with conditional</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289304#M868213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The data showed oboved is also grouped by date and by departments. It's similar to something like that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Category&amp;nbsp;&amp;nbsp;&amp;nbsp; YYYYMM&amp;nbsp;&amp;nbsp;&amp;nbsp; Value&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;STRONG&gt;Department&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Sales&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201601&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4000,00&amp;nbsp;&amp;nbsp;&amp;nbsp; Dep1&lt;/P&gt;&lt;P&gt;Sales&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201602&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3000,00&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;Dep2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Costs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201601&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3500,00&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;Dep1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Sales&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201603&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1000,00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;Dep1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Costs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201602&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2700,00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;Dep2&lt;/SPAN&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; &lt;/P&gt;&lt;P&gt;Costs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201601&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1000,00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;Dep1&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 13:41:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289304#M868213</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-06T13:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated field with conditional</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289305#M868214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Vineeth. You're right, but I would like to have it calculated in my data load editor. I thought it would be calculated like in i.e. SQL table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 13:46:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289305#M868214</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-06T13:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated field with conditional</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289306#M868215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD Department,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; YYYYMM,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;If(Category='Sales', Amount) - Sum(If(Category='Costs', Amount) as Profit&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM....&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Group By Department, YYYYMM;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 13:47:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289306#M868215</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-06T13:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated field with conditional</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289307#M868216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;but if you do that in script your profit value will remain static , which means your Profit will always be on a level which you GroupBy and won't dynamically change if you add remove dimensions in the chart.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 13:53:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289307#M868216</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2016-12-06T13:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated field with conditional</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289308#M868217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I understand, I didn't know how does it work exactly. Thank you for your hints Vineeth.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 14:10:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289308#M868217</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-06T14:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated field with conditional</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289309#M868218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Vineeth has shown me that I make logic mistake with those dimensions. I didn't know that I have to use group by when I use sum in data load editor, it is similar like in i.e. sql server queries. Thank you Sunny T, the example you showed me also works fine (I'vr checked it) but I have to agree to constraints with group by which I wasn't aware.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 14:43:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289309#M868218</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-06T14:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated field with conditional</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289310#M868219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then I would suggest marking his response as correct instead of mine &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 14:45:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289310#M868219</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-06T14:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated field with conditional</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289311#M868220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 15:07:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-field-with-conditional/m-p/1289311#M868220</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-06T15:07:01Z</dc:date>
    </item>
  </channel>
</rss>

