<?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 Variables - Passing a String as an argument in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Variables-Passing-a-String-as-an-argument/m-p/1594271#M43707</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have 2 variables defined as follows:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vBenchmarks&lt;BR /&gt;&lt;/STRONG&gt;&lt;SPAN&gt;fractile( {$&amp;lt;Konto = $1, [Benchmark.Liegenschaftstyp] =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;{$(vLiegenschaftstyp)}&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;, [Benchmark.Bewertungsjahr] = $(vReport_Jahr) &amp;gt;} [Benchmark.Wert] , $2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vLiegenschaftstyp&lt;BR /&gt;&lt;/STRONG&gt;chr(39)&amp;amp;[Bewertung.Liegenschaftstyp]&amp;amp;chr(39)&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The field&amp;nbsp;&lt;STRONG&gt;[Bewertung.Liegenschaftstyp]&amp;nbsp;&lt;/STRONG&gt;contains strings such as 'Wohnen', 'Geschäft/Büro',...&lt;/P&gt;&lt;P&gt;My variable vBenchmarks is not giving an output. However the output is correctly calculated if I use this expression instead:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;fractile( {$&amp;lt;Konto = $1, [Benchmark.Liegenschaftstyp] =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;{'Wohnen'}&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;, [Benchmark.Bewertungsjahr] = $(vReport_Jahr) &amp;gt;} [Benchmark.Wert] , $2)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Therefore the problem must arise when passing the variable vLiegenschaftstyp to vBenchmarks. What can I do to make it work? I assume it has to do something with string formating?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried nearly all possible variants to define vLiegenschaftstyp:&lt;BR /&gt;[Bewertung.Liegenschaftstyp], =[Bewertung.Liegenschaftstyp], text([Bewertung.Liegenschaftstyp]), =text([Bewertung.Liegenschaftstyp]),...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance&lt;BR /&gt;Hjalmar&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 20:37:16 GMT</pubDate>
    <dc:creator>hjalmars</dc:creator>
    <dc:date>2024-11-16T20:37:16Z</dc:date>
    <item>
      <title>Variables - Passing a String as an argument</title>
      <link>https://community.qlik.com/t5/App-Development/Variables-Passing-a-String-as-an-argument/m-p/1594271#M43707</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have 2 variables defined as follows:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vBenchmarks&lt;BR /&gt;&lt;/STRONG&gt;&lt;SPAN&gt;fractile( {$&amp;lt;Konto = $1, [Benchmark.Liegenschaftstyp] =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;{$(vLiegenschaftstyp)}&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;, [Benchmark.Bewertungsjahr] = $(vReport_Jahr) &amp;gt;} [Benchmark.Wert] , $2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vLiegenschaftstyp&lt;BR /&gt;&lt;/STRONG&gt;chr(39)&amp;amp;[Bewertung.Liegenschaftstyp]&amp;amp;chr(39)&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The field&amp;nbsp;&lt;STRONG&gt;[Bewertung.Liegenschaftstyp]&amp;nbsp;&lt;/STRONG&gt;contains strings such as 'Wohnen', 'Geschäft/Büro',...&lt;/P&gt;&lt;P&gt;My variable vBenchmarks is not giving an output. However the output is correctly calculated if I use this expression instead:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;fractile( {$&amp;lt;Konto = $1, [Benchmark.Liegenschaftstyp] =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;{'Wohnen'}&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;, [Benchmark.Bewertungsjahr] = $(vReport_Jahr) &amp;gt;} [Benchmark.Wert] , $2)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Therefore the problem must arise when passing the variable vLiegenschaftstyp to vBenchmarks. What can I do to make it work? I assume it has to do something with string formating?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried nearly all possible variants to define vLiegenschaftstyp:&lt;BR /&gt;[Bewertung.Liegenschaftstyp], =[Bewertung.Liegenschaftstyp], text([Bewertung.Liegenschaftstyp]), =text([Bewertung.Liegenschaftstyp]),...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance&lt;BR /&gt;Hjalmar&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:37:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variables-Passing-a-String-as-an-argument/m-p/1594271#M43707</guid>
      <dc:creator>hjalmars</dc:creator>
      <dc:date>2024-11-16T20:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Variables - Passing a String as an argument</title>
      <link>https://community.qlik.com/t5/App-Development/Variables-Passing-a-String-as-an-argument/m-p/1594755#M43760</link>
      <description>&lt;P&gt;Try changing the expression to this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;fractile( {$&amp;lt;Konto = $1, [Benchmark.Liegenschaftstyp] =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;{'$(vLiegenschaftstyp)'}&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;, [Benchmark.Bewertungsjahr] = $(vReport_Jahr) &amp;gt;} [Benchmark.Wert] , $2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When you pass the variable, lets say 'Wohnen', the param is passed withouth the apostrophes, giving you an incomplete set analysis, like below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;expression('Wohnen') gives as a result for the set analysis:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;fractile( {$&amp;lt;Konto = $1, [Benchmark.Liegenschaftstyp] =&amp;nbsp;&lt;SPAN class="s1"&gt;{Wohnen}&amp;nbsp;&lt;/SPAN&gt;, [Benchmark.Bewertungsjahr] = $(vReport_Jahr) &amp;gt;} [Benchmark.Wert] , $2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 20:43:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variables-Passing-a-String-as-an-argument/m-p/1594755#M43760</guid>
      <dc:creator>felipedl</dc:creator>
      <dc:date>2019-06-21T20:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Variables - Passing a String as an argument</title>
      <link>https://community.qlik.com/t5/App-Development/Variables-Passing-a-String-as-an-argument/m-p/1594929#M43778</link>
      <description>&lt;P&gt;Thanks, this sounds absolutely reasonable, however it didn't work in my particular case for some reason. In the meantime I found out that this works surprisingly:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;vLiegenschaftstyp:&lt;BR /&gt;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;chr(123)&amp;amp;chr(39)&amp;amp;[Bewertung.Liegenschaftstyp]&amp;amp;chr(39)&amp;amp;chr(125)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;vBenchmarks:&lt;BR /&gt;&lt;SPAN class="s1"&gt;= fractile( {$&amp;lt;Konto = &amp;nbsp;$1, [Benchmark.Liegenschaftstyp] = $($(vLiegenschaftstyp)), [Benchmark.Bewertungsjahr] = $(vReport_Jahr) &amp;gt;} [Benchmark.Wert] &amp;nbsp;, &amp;nbsp;$2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But still I'm not really able to understand why making a double $-sign expansion helps...&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 07:14:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variables-Passing-a-String-as-an-argument/m-p/1594929#M43778</guid>
      <dc:creator>hjalmars</dc:creator>
      <dc:date>2019-06-24T07:14:16Z</dc:date>
    </item>
  </channel>
</rss>

