<?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: How to use a variable in a calculated dimension with an IF statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-in-a-calculated-dimension-with-an-IF/m-p/1635285#M446735</link>
    <description>&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;I dont really understand the inline thing but i did think the idea of doing in the script was good, so i created a new dimension and that worked&lt;/P&gt;&lt;P&gt;if(match(portfolio,'02502028', '22001206')&amp;gt;=1, 'Quoted','Unquoted') as portfolio_quoted,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;</description>
    <pubDate>Tue, 15 Oct 2019 09:25:51 GMT</pubDate>
    <dc:creator>paul_ripley</dc:creator>
    <dc:date>2019-10-15T09:25:51Z</dc:date>
    <item>
      <title>How to use a variable in a calculated dimension with an IF statement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-in-a-calculated-dimension-with-an-IF/m-p/1635010#M446722</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I have a variable vQuoted.&amp;nbsp; It contain the values&amp;nbsp;'02502028','22001206'&lt;/P&gt;&lt;P&gt;I'd like to use a calculated dimension and have done the below. Portfolio is another dimension&lt;/P&gt;&lt;P&gt;The below gives an error&amp;nbsp;&lt;/P&gt;&lt;P&gt;=if(portfolio = $(vQuoted),'Quoted','Unquoted')&lt;/P&gt;&lt;P&gt;I did also try the below which didnt give an error but it doesnt calculate the variables&lt;/P&gt;&lt;P&gt;=if(portfolio = vQuoted,'Quoted','Unquoted')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 02:13:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-in-a-calculated-dimension-with-an-IF/m-p/1635010#M446722</guid>
      <dc:creator>paul_ripley</dc:creator>
      <dc:date>2024-11-16T02:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a variable in a calculated dimension with an IF statement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-in-a-calculated-dimension-with-an-IF/m-p/1635064#M446723</link>
      <description>&lt;P&gt;You can solve this at load time (script)...&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SET vQuoted = 02502028, 22001206;

Test:
NOCONCATENATE 
LOAD *, If(Index('$(vQuoted)', Portfolio), 'Quoted', 'Unquoted') AS Dim
INLINE [
        Portfolio,
        02502028
        22001206
        22001207
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use Dim field (From &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Script&lt;/STRONG&gt;&lt;/FONT&gt;). Otherwise, add calculated dimension (&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;FRONTEND&lt;/FONT&gt;&lt;/STRONG&gt;).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="clipboard_image_0.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/21466i1D70C1FEAF372695/image-size/large?v=v2&amp;amp;px=999" role="button" title="clipboard_image_0.png" alt="clipboard_image_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 16:31:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-in-a-calculated-dimension-with-an-IF/m-p/1635064#M446723</guid>
      <dc:creator>JGMDataAnalysis</dc:creator>
      <dc:date>2019-10-14T16:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a variable in a calculated dimension with an IF statement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-in-a-calculated-dimension-with-an-IF/m-p/1635285#M446735</link>
      <description>&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;I dont really understand the inline thing but i did think the idea of doing in the script was good, so i created a new dimension and that worked&lt;/P&gt;&lt;P&gt;if(match(portfolio,'02502028', '22001206')&amp;gt;=1, 'Quoted','Unquoted') as portfolio_quoted,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 09:25:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-in-a-calculated-dimension-with-an-IF/m-p/1635285#M446735</guid>
      <dc:creator>paul_ripley</dc:creator>
      <dc:date>2019-10-15T09:25:51Z</dc:date>
    </item>
  </channel>
</rss>

