<?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 sum from different fields in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202708#M60308</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It just gives me the freedom to use dynamic field names in a calculation,&lt;/P&gt;&lt;P&gt;it is very useful when for each dimension row you'd like to use a different calculation.. especially for P&amp;amp;L reports.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Sep 2009 23:11:11 GMT</pubDate>
    <dc:creator>xtrimf</dc:creator>
    <dc:date>2009-09-29T23:11:11Z</dc:date>
    <item>
      <title>sum from different fields</title>
      <link>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202706#M60306</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;Is it possible to write a dynamic expression in a pivot / straight table without "if" clause?&lt;/P&gt;&lt;P&gt;for example, an expression that sums a field according to row number :&lt;/P&gt;&lt;P&gt;row1, sum(Field1)&lt;/P&gt;&lt;P&gt;row2, sum(Field2) etc...\&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;something along "sum(Field&amp;amp;rowno())" that will work ? &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, 29 Sep 2009 21:46:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202706#M60306</guid>
      <dc:creator>xtrimf</dc:creator>
      <dc:date>2009-09-29T21:46:43Z</dc:date>
    </item>
    <item>
      <title>sum from different fields</title>
      <link>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202707#M60307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What would be the purpose / intension to do so? The usual way would be to have Field1, Field2 etc as Dimension and then Sum(xxx) as expression.&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 21:59:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202707#M60307</guid>
      <dc:creator>prieper</dc:creator>
      <dc:date>2009-09-29T21:59:32Z</dc:date>
    </item>
    <item>
      <title>sum from different fields</title>
      <link>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202708#M60308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It just gives me the freedom to use dynamic field names in a calculation,&lt;/P&gt;&lt;P&gt;it is very useful when for each dimension row you'd like to use a different calculation.. especially for P&amp;amp;L reports.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 23:11:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202708#M60308</guid>
      <dc:creator>xtrimf</dc:creator>
      <dc:date>2009-09-29T23:11:11Z</dc:date>
    </item>
    <item>
      <title>sum from different fields</title>
      <link>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202709#M60309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sum your values in your load script and display it in a straight table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 23:22:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202709#M60309</guid>
      <dc:creator />
      <dc:date>2009-09-29T23:22:20Z</dc:date>
    </item>
    <item>
      <title>sum from different fields</title>
      <link>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202710#M60310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But then I think it might make even more sense to assign certain fields to a variable and to build then your pivot or other charts on basis this variable?&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 23:23:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202710#M60310</guid>
      <dc:creator>prieper</dc:creator>
      <dc:date>2009-09-29T23:23:08Z</dc:date>
    </item>
    <item>
      <title>sum from different fields</title>
      <link>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202711#M60311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it would still force me to use "IF" clause&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 23:30:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202711#M60311</guid>
      <dc:creator>xtrimf</dc:creator>
      <dc:date>2009-09-29T23:30:28Z</dc:date>
    </item>
    <item>
      <title>sum from different fields</title>
      <link>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202712#M60312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"Sum your values in your load script and display it in a straight table."&lt;/P&gt;&lt;P&gt;where's the fun in that? &lt;IMG alt="Wink" src="http://community.qlik.com/emoticons/emotion-5.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 23:35:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202712#M60312</guid>
      <dc:creator>xtrimf</dc:creator>
      <dc:date>2009-09-29T23:35:19Z</dc:date>
    </item>
    <item>
      <title>sum from different fields</title>
      <link>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202713#M60313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;xtrim wrote:it would still force me to use "IF" clause&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I guess I'm confused. What's wrong with using an IF clause? Are you worried about performance? In this case, the IF is outside of the summation, so it should be very efficient:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;if(rowno()=1,sum(Field1)&lt;BR /&gt;,if(rowno()=2,sum(Field2)&lt;BR /&gt;,if(rowno()=3,sum(Field3))))&lt;/P&gt;&lt;P&gt;Not that it will perform any differently than an IF, but I'd probably use pick() instead for brevity:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;pick(rowno(),sum(Field1),sum(Field2),sum(Field3))&lt;/P&gt;&lt;P&gt;Performance should only be a problem if you embed the pick() in the sum, so I don't recommend this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;sum(pick(rowno(),Field1,Field2,Field3))&lt;/P&gt;&lt;P&gt;But even there, it's possible that QlikView is smart enough to realize that rowno() doesn't have to be calculated every time, and will perform just fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 23:43:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202713#M60313</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-09-29T23:43:09Z</dc:date>
    </item>
    <item>
      <title>sum from different fields</title>
      <link>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202714#M60314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The fun is in getting the job done fast and easy. &lt;IMG alt="Geeked" src="http://community.qlik.com/emoticons/emotion-15.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 23:44:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202714#M60314</guid>
      <dc:creator />
      <dc:date>2009-09-29T23:44:17Z</dc:date>
    </item>
    <item>
      <title>sum from different fields</title>
      <link>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202715#M60315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have about a hundred rows in each report...that is why i'm trying to avoid the if.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 23:49:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202715#M60315</guid>
      <dc:creator>xtrimf</dc:creator>
      <dc:date>2009-09-29T23:49:32Z</dc:date>
    </item>
    <item>
      <title>sum from different fields</title>
      <link>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202716#M60316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"The fun is in getting the job done fast and easy. "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and easy maintenance too? &lt;IMG alt="Surprise" src="http://community.qlik.com/emoticons/emotion-3.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 23:51:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202716#M60316</guid>
      <dc:creator>xtrimf</dc:creator>
      <dc:date>2009-09-29T23:51:04Z</dc:date>
    </item>
    <item>
      <title>sum from different fields</title>
      <link>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202717#M60317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;xtrim wrote:&lt;BR /&gt;"The fun is in getting the job done fast and easy. "&lt;BR /&gt;&lt;BR /&gt;and easy maintenance too? &lt;IMG alt="Surprise" src="http://community.qlik.com/emoticons/emotion-3.gif" /&gt;&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;What exactly is your requirement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Sep 2009 00:03:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202717#M60317</guid>
      <dc:creator />
      <dc:date>2009-09-30T00:03:20Z</dc:date>
    </item>
    <item>
      <title>sum from different fields</title>
      <link>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202718#M60318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, so then EVERY one of the 100 expressions is a simple sum, just of a different field? And your fields really ARE named Field1, Field2 and so on? If so, that sounds very strange, and I might understand your question, but I don't think I understand your requirement. And I don't think I have an answer for your question, as I'm not sure there's any way to do something like sum(Field&amp;amp;rowno()). I could be wrong. But there also might be a way to meet your real requirement without having 100 fields with "nonsense" names and 100 separate sum statements. So like dragonauta, I'd like more information on your actual requirement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Sep 2009 00:24:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202718#M60318</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-09-30T00:24:21Z</dc:date>
    </item>
    <item>
      <title>sum from different fields</title>
      <link>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202719#M60319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The situation is that I need to build a report between to non-linked tables.&lt;/P&gt;&lt;P&gt;One table holds the report categories, and the other the Data.&lt;/P&gt;&lt;P&gt;It is not possible to link between them for various reasons.&lt;/P&gt;&lt;P&gt;For each category (Dimention) I need a different calculation (not just sum(Field1)).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as was previously suggested, In my load script i calculated the complex things and already insert each calc in different field,&lt;/P&gt;&lt;P&gt;so in the end all I would have to do is sum(FieldX), but still the "IF' is bugging me....&lt;/P&gt;&lt;P&gt;maybe its the only solution, I don't know...just trying.&lt;/P&gt;&lt;P&gt;strange that a simple thing like dynamic field name is not built-in...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Sep 2009 03:40:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202719#M60319</guid>
      <dc:creator>xtrimf</dc:creator>
      <dc:date>2009-09-30T03:40:41Z</dc:date>
    </item>
    <item>
      <title>sum from different fields</title>
      <link>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202720#M60320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If for each category you "need a different calculation (not just sum(Field1))", then I am again failing to see what is wrong with either an if() or a pick(). You MUST specify every calculation SOMEWHERE. So there's no way around writing 100 calculations. The overhead of a pick() is negligible if you can use rowno().&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;pick(rowno()&lt;BR /&gt;,expression 1&lt;BR /&gt;,expression 2&lt;BR /&gt;,expression 3&lt;BR /&gt;...&lt;BR /&gt;,expression 100)&lt;/P&gt;&lt;P&gt;However, depending on how everything is laid out, you might be able to handle it in the script. I'm guessing you might be able to have a table with ID/expression/result fields:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;ID expression result&lt;BR /&gt;12345 total sales 5000&lt;BR /&gt;12345 avarage monthly sales 300&lt;BR /&gt;12345 total cost 4000&lt;/P&gt;&lt;P&gt;And then your chart would have "expression" as a dimension. You'd probably set up the table with a crosstable load:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;CROSSTABLE (expression,result)&lt;BR /&gt;LOAD&lt;BR /&gt; ID&lt;BR /&gt;,expression 1 as "total sales"&lt;BR /&gt;,expression 2 as "average monthly sales"&lt;BR /&gt;,expression 3 as "total cost"&lt;BR /&gt;...&lt;BR /&gt;,expression 100 as "whatever"&lt;BR /&gt;FROM YourTable&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;Now again, you're still having to maintain all 100 expressions, as there's no way around that. But you might get a performance benefit from doing it during the load rather than at execution time. Execution time might be more flexible, however, since it can for instance refer to fields from multiple tables.&lt;/P&gt;&lt;P&gt;I do think a weakness of QlikView is the ability to refer to different meanings of fields, in this case the inability (?) to assemble the field name with string commands and then just use it like a field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Sep 2009 04:13:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-from-different-fields/m-p/202720#M60320</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-09-30T04:13:29Z</dc:date>
    </item>
  </channel>
</rss>

