<?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: Variable definition in Expression in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Variable-definition-in-Expression/m-p/2133313#M92097</link>
    <description>&lt;P&gt;&lt;SPAN&gt;[Metroplex-&lt;/SPAN&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;SPAN&gt;]={'&lt;/SPAN&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;SPAN&gt;'}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;[Metroplex-&lt;STRONG&gt;1&lt;/STRONG&gt;]={'&lt;STRONG&gt;2&lt;/STRONG&gt;'}...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Oct 2023 11:29:33 GMT</pubDate>
    <dc:creator>LukaIT</dc:creator>
    <dc:date>2023-10-31T11:29:33Z</dc:date>
    <item>
      <title>Variable definition in Expression</title>
      <link>https://community.qlik.com/t5/App-Development/Variable-definition-in-Expression/m-p/2111871#M90825</link>
      <description>&lt;P&gt;I have this simple Expression and my question is can I and how to make things simple?&lt;/P&gt;
&lt;P&gt;Metroplex-1={'1'} needs to be changed to 2,3,4,5,6,7 in other expressions (I copy-paste it 6 times and then change '1' to '2' in the whole expression which is really painful and a waste of time.&lt;/P&gt;
&lt;P&gt;Can I use Variable for [Metroplex-1] in Expression so that instead of changing 10 times I change Variable in Expression on one place and Expression is using it? or any other suggestions on how to make things a bit faster.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;My Expression:&lt;/P&gt;
&lt;P&gt;(((Count({$&amp;lt;FleetBookAgreement={'Rental'},[Metroplex-1]={'1'}&amp;gt;}FleetBookAgreement)+&lt;BR /&gt;Count({$&amp;lt;FleetBookAgreement={'Booking'},resStatus_Name={'Active'},[Metroplex-1]={'1'}&amp;gt;}FleetBookAgreement))&lt;BR /&gt;-&lt;BR /&gt;Count({$&amp;lt;FleetBookAgreement={'Rental'},CountXto-={1},[Metroplex-1]={'1'}&amp;gt;}FleetBookAgreement))&lt;BR /&gt;-&lt;/P&gt;
&lt;P&gt;((Count({$&amp;lt;FleetBookAgreement={'Rental'},res7day={'N'},[Metroplex-1]={'1'}&amp;gt;}FleetBookAgreement)+&lt;BR /&gt;Count({$&amp;lt;FleetBookAgreement={'Booking'},resStatus_Name={'Active'},res7day={'N'},[Metroplex-1]={'1'}&amp;gt;}FleetBookAgreement))&lt;BR /&gt;-&lt;BR /&gt;Count({$&amp;lt;FleetBookAgreement={'Rental'},CountXto-={1},res7day={'N'},[Metroplex-1]={'1'}&amp;gt;}FleetBookAgreement))&lt;/P&gt;
&lt;P&gt;+&lt;BR /&gt;(Count({$&amp;lt;IgnoreOOS={'Y'},[Metroplex-1]={'1'}&amp;gt;}OOS)&lt;BR /&gt;-Count({$&amp;lt;IgnoreOOS={'Y'},res7day={'N'},[Metroplex-1]={'1'}&amp;gt;}OOS))&lt;BR /&gt;-Count({$&amp;lt;IgnoreOOS-={'Y'},res7day={'N'},OOSgroup={'Mirovanje'},[Metroplex-1]={'1'}&amp;gt;}OOS))&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;/&lt;BR /&gt;(&lt;BR /&gt;Count({$&amp;lt;TYPE={'FleetHistory'},PlanType-={'Defleeted'},Future={'N'},[Metroplex-1]={'1'}&amp;gt;}distinct XCarPlateno)+Sum({$&amp;lt;Future={'Y'},Xyear={$(vCurYear)},[Metroplex-1]={'1'}&amp;gt;}poKOM)+Count({$&amp;lt;Future={'Y'},[Metroplex-1]={'1'}&amp;gt;}distinct CarId)&lt;BR /&gt;+Count({$&amp;lt;Type={'OW'},Future={'Y'},[Metroplex-1]={'1'}&amp;gt;}OWplusId)&lt;BR /&gt;-&lt;BR /&gt;Count({$&amp;lt;Type={'OW'},Future={'Y'},[Metroplex-1]={'1'}&amp;gt;}OWminusId)&lt;/P&gt;
&lt;P&gt;-Count({$&amp;lt;IgnoreOOS-={'Y'},Future={'Y'},OOSgroup={'Mirovanje'},[Metroplex-1]={'1'}&amp;gt;}OOS))&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 12:47:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable-definition-in-Expression/m-p/2111871#M90825</guid>
      <dc:creator>LukaIT</dc:creator>
      <dc:date>2023-08-31T12:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: Variable definition in Expression</title>
      <link>https://community.qlik.com/t5/App-Development/Variable-definition-in-Expression/m-p/2111883#M90827</link>
      <description>&lt;P&gt;It's not clear which number do you want to adjust - within the field or the field-value?&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;[Metroplex-&lt;STRONG&gt;1&lt;/STRONG&gt;]={'&lt;STRONG&gt;1&lt;/STRONG&gt;'}&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 13:01:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable-definition-in-Expression/m-p/2111883#M90827</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-08-31T13:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Variable definition in Expression</title>
      <link>https://community.qlik.com/t5/App-Development/Variable-definition-in-Expression/m-p/2133313#M92097</link>
      <description>&lt;P&gt;&lt;SPAN&gt;[Metroplex-&lt;/SPAN&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;SPAN&gt;]={'&lt;/SPAN&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;SPAN&gt;'}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;[Metroplex-&lt;STRONG&gt;1&lt;/STRONG&gt;]={'&lt;STRONG&gt;2&lt;/STRONG&gt;'}...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 11:29:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable-definition-in-Expression/m-p/2133313#M92097</guid>
      <dc:creator>LukaIT</dc:creator>
      <dc:date>2023-10-31T11:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Variable definition in Expression</title>
      <link>https://community.qlik.com/t5/App-Development/Variable-definition-in-Expression/m-p/2133643#M92132</link>
      <description>&lt;P&gt;You may replace it with a variable which would change the call to:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;[Metroplex-&lt;/SPAN&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;SPAN&gt;]={$(&lt;/SPAN&gt;&lt;STRONG&gt;myVar&lt;/STRONG&gt;&lt;SPAN&gt;)}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;An alternatively would be to use a field-selection for it. Most simple would be to provide the field&amp;nbsp;&lt;SPAN&gt;[Metroplex-&lt;/SPAN&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;SPAN&gt;] directly which would be the most natural way - the user just selects what's interesting. But you may also provide a not related field per island-table and then the call may look like:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;[Metroplex-&lt;/SPAN&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;SPAN&gt;] = p(MySelectionField)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 08:24:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable-definition-in-Expression/m-p/2133643#M92132</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-11-01T08:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Variable definition in Expression</title>
      <link>https://community.qlik.com/t5/App-Development/Variable-definition-in-Expression/m-p/2136280#M92347</link>
      <description>&lt;P&gt;Hi Marcus,&lt;/P&gt;
&lt;P&gt;could I define myVar in Expression?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is KPI and it has around 30 expressions in each group.&lt;BR /&gt;Each group has its own Metroplex 1,2,3,4... so instead of changing each expression, the Metroplex number 10-20 times I would like to change 1 variable on the top of the expression, and with it I won't need to edit 500-600 variables &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Hoping you understand me&lt;/P&gt;
&lt;P&gt;The user is not selecting anything, if needed they use filters but this is a KPI that is divided into 11 metroplexes so you can see each of them without filtering&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KPI-view.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/119652iD2174384DDF34AAD/image-size/large?v=v2&amp;amp;px=999" role="button" title="KPI-view.png" alt="KPI-view.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 12:50:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable-definition-in-Expression/m-p/2136280#M92347</guid>
      <dc:creator>LukaIT</dc:creator>
      <dc:date>2023-11-09T12:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: Variable definition in Expression</title>
      <link>https://community.qlik.com/t5/App-Development/Variable-definition-in-Expression/m-p/2136298#M92349</link>
      <description>&lt;P&gt;You may use parametrized variables, like:&lt;/P&gt;
&lt;P&gt;myVar:&lt;BR /&gt;sum({&amp;lt; $1 = {$2}&amp;gt;} $3)&lt;/P&gt;
&lt;P&gt;and calling them like:&lt;/P&gt;
&lt;P&gt;$(myVar(Field1, ValueXYZ, Field2))&lt;/P&gt;
&lt;P&gt;which could reduce the number of needed variables quite significantly.&lt;/P&gt;
&lt;P&gt;But you will further need to adjust this variable-expression by each call. You are just minimizing the lengths of the expression which has benefits (easier to maintain) as well as disadvantages (loosing overview).&lt;/P&gt;
&lt;P&gt;More simple and more performant would be to use table-charts instead of KPI objects. It won't provide this amount of layout-capabilities but is also able to display the essential information.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 13:17:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable-definition-in-Expression/m-p/2136298#M92349</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-11-09T13:17:57Z</dc:date>
    </item>
  </channel>
</rss>

