<?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: Use a Formula loaded from database in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Use-a-Formula-loaded-from-database/m-p/2435397#M96964</link>
    <description>&lt;P&gt;Thank you for your reply, I'm gonna try that.&lt;/P&gt;</description>
    <pubDate>Thu, 28 Mar 2024 05:46:21 GMT</pubDate>
    <dc:creator>markuskoessler</dc:creator>
    <dc:date>2024-03-28T05:46:21Z</dc:date>
    <item>
      <title>Use a Formula loaded from database</title>
      <link>https://community.qlik.com/t5/App-Development/Use-a-Formula-loaded-from-database/m-p/2435215#M96953</link>
      <description>&lt;P&gt;Hi veryone,&lt;/P&gt;
&lt;P&gt;is it possible to use a formula in a pivot table which was loaded from database?&lt;/P&gt;
&lt;P&gt;I've loaded a table from our database which looks like that&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="markuskoessler_0-1711549102436.png" style="width: 497px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/162833i7E047A21EE71AAE5/image-dimensions/497x82?v=v2" width="497" height="82" role="button" title="markuskoessler_0-1711549102436.png" alt="markuskoessler_0-1711549102436.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;those formulas work if I use them directly in my pivot table, but not if use the field which stores the formulas,&lt;/P&gt;
&lt;P&gt;I'm ending with something like that&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="markuskoessler_1-1711549214995.png" style="width: 587px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/162834iD3C6C20661A28E7B/image-dimensions/587x203?v=v2" width="587" height="203" role="button" title="markuskoessler_1-1711549214995.png" alt="markuskoessler_1-1711549214995.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Within the pivot table I've several If-Statements like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if(SPALTEBVBEZEICHNUNG='Vorjahr',&lt;BR /&gt;if(SPALTEBVID=1,KENNZAHL_KONTAKTE_VJ,&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;where&amp;nbsp;KENNZAHL_KONTAKTE_VJ is one of my fields storing a formula.&lt;/P&gt;
&lt;P&gt;I've tried to write it like&amp;nbsp;'$(=KENNZAHL_KONTAKTE_VJ)' or&amp;nbsp;=$(=KENNZAHL_KONTAKTE_VJ) but i just don't get it.&lt;/P&gt;
&lt;P&gt;Maybe someone has a hint for me?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;Markus&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 14:25:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Use-a-Formula-loaded-from-database/m-p/2435215#M96953</guid>
      <dc:creator>markuskoessler</dc:creator>
      <dc:date>2024-03-27T14:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Use a Formula loaded from database</title>
      <link>https://community.qlik.com/t5/App-Development/Use-a-Formula-loaded-from-database/m-p/2435277#M96959</link>
      <description>&lt;P&gt;What you are trying isn't possible because a field-content is always a number or a string and won't be interpreted as expression. If you apply something like: $(=Field) you creates an adhoc-variable which is resolved before the chart is calculated and applied to each row - means if you has always only a single calculation it would be applicable but not if you want different calculations in regard to the dimension-values.&lt;/P&gt;
&lt;P&gt;By different calculations to the dimensions you will need nested if-loops, like:&lt;/P&gt;
&lt;P&gt;if(Dim = 'x', Expr1, if(Dim = 'y', Expr2, ...)&lt;/P&gt;
&lt;P&gt;That's technically possible but a rather ugly approach and not very performant because all branches within the if-loop will be calculated at first and picking the right then/else result is the second step. From a handling point of view the nested if-loop might be optimized by using a pick(match()) in which lookup and returns are aggregated strings over the expressions but it will cause further complexity.&lt;/P&gt;
&lt;P&gt;Better as the above stuff would be to adjust the data-model and to associate all data properly which means to move the logic from the expressions to the dimensional layer and then simple sum() and count() in the objects will be enough.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 16:49:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Use-a-Formula-loaded-from-database/m-p/2435277#M96959</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2024-03-27T16:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Use a Formula loaded from database</title>
      <link>https://community.qlik.com/t5/App-Development/Use-a-Formula-loaded-from-database/m-p/2435397#M96964</link>
      <description>&lt;P&gt;Thank you for your reply, I'm gonna try that.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 05:46:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Use-a-Formula-loaded-from-database/m-p/2435397#M96964</guid>
      <dc:creator>markuskoessler</dc:creator>
      <dc:date>2024-03-28T05:46:21Z</dc:date>
    </item>
  </channel>
</rss>

