<?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: Defining Set variables with functions in them in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Defining-Set-variables-with-functions-in-them/m-p/2163519#M94471</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/92034"&gt;@waleeed_mahmood&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I think the issue is with using Right(). You are passing something like :&lt;/P&gt;
&lt;P&gt;FQuarter={"&amp;lt;=2"}, when selection is FQuarter is Q-2. but your field FQuarter is a string, such range selections wont work on string field. Instead you need to create another Field&amp;nbsp;FQuarterNum in your calendar which will have numerical values 1,2,3,4 for Quarter. &amp;amp; use that in your set variable.&lt;/P&gt;
&lt;P&gt;FQuarterNum={"&lt;SPAN&gt;&amp;lt;=$(=right(GetFieldSelections(FQuarter),1))&lt;/SPAN&gt;"}&lt;/P&gt;
&lt;P&gt;Try something like this, &amp;amp; Let me know if it worked.&lt;/P&gt;
&lt;P&gt;*Edit*&lt;/P&gt;
&lt;P&gt;Hi, I later realized that getfieldselections won't pass a single selections until Select only one value is enabled for that specific field. Check on that part as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Rohan.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 20 Jan 2024 05:35:29 GMT</pubDate>
    <dc:creator>Rohan</dc:creator>
    <dc:date>2024-01-20T05:35:29Z</dc:date>
    <item>
      <title>Defining Set variables with functions in them</title>
      <link>https://community.qlik.com/t5/App-Development/Defining-Set-variables-with-functions-in-them/m-p/2163158#M94425</link>
      <description>&lt;P&gt;Hi I have variables defined in my load editors and they are something like this:&lt;/P&gt;
&lt;P&gt;SET v1 =&amp;nbsp;Sum({$&amp;lt;[VIType]={'Account'}, [FQuarter]={"&amp;lt;=$(=right(GetFieldSelections(FQuarter),1))"}, [fYear]-=&amp;gt;} [Customer Targets]) ;&lt;/P&gt;
&lt;P&gt;If i use them in a table like&lt;/P&gt;
&lt;P&gt;=Sum({$&amp;lt;[VIType]={'Account'}, [FQuarter]={"&amp;lt;=$(=right(GetFieldSelections(FQuarter),1))"}, [fYear]-=&amp;gt;} [Customer Targets])&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it works fine. However, when i use this variable in a table like $(v1), it doesnt work. The statement in "" doesnt resolve.&lt;/P&gt;
&lt;P&gt;It shows&amp;nbsp;[FQuarter]={"&amp;lt;="}.&lt;/P&gt;
&lt;P&gt;Any ideas how to fix this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 06:51:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Defining-Set-variables-with-functions-in-them/m-p/2163158#M94425</guid>
      <dc:creator>waleeed_mahmood</dc:creator>
      <dc:date>2024-01-19T06:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Defining Set variables with functions in them</title>
      <link>https://community.qlik.com/t5/App-Development/Defining-Set-variables-with-functions-in-them/m-p/2163269#M94443</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/92034"&gt;@waleeed_mahmood&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Have you tried using '=' before the Variable in the measure expression ? Also this expression wont evaluate until you make selections in the Quarter field on the dashbaord.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Rohan.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 11:47:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Defining-Set-variables-with-functions-in-them/m-p/2163269#M94443</guid>
      <dc:creator>Rohan</dc:creator>
      <dc:date>2024-01-19T11:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: Defining Set variables with functions in them</title>
      <link>https://community.qlik.com/t5/App-Development/Defining-Set-variables-with-functions-in-them/m-p/2163307#M94448</link>
      <description>&lt;P&gt;Try with:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;LET v1 = 'Sum({'&amp;amp;chr(36)&amp;amp;'&amp;lt;[VIType]={''Account''}, [FQuarter]={"&amp;lt;='&amp;amp;chr(36)&amp;amp;'(=right(GetFieldSelections(FQuarter),1))"}, [fYear]-=&amp;gt;} [Customer Targets])' ;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 13:30:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Defining-Set-variables-with-functions-in-them/m-p/2163307#M94448</guid>
      <dc:creator>vincent_ardiet_</dc:creator>
      <dc:date>2024-01-19T13:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Defining Set variables with functions in them</title>
      <link>https://community.qlik.com/t5/App-Development/Defining-Set-variables-with-functions-in-them/m-p/2163349#M94453</link>
      <description>&lt;P&gt;Hi, Its not a variable but a field in my master calendar. and yes the quarter selection is fixed.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 15:17:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Defining-Set-variables-with-functions-in-them/m-p/2163349#M94453</guid>
      <dc:creator>waleeed_mahmood</dc:creator>
      <dc:date>2024-01-19T15:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: Defining Set variables with functions in them</title>
      <link>https://community.qlik.com/t5/App-Development/Defining-Set-variables-with-functions-in-them/m-p/2163519#M94471</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/92034"&gt;@waleeed_mahmood&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I think the issue is with using Right(). You are passing something like :&lt;/P&gt;
&lt;P&gt;FQuarter={"&amp;lt;=2"}, when selection is FQuarter is Q-2. but your field FQuarter is a string, such range selections wont work on string field. Instead you need to create another Field&amp;nbsp;FQuarterNum in your calendar which will have numerical values 1,2,3,4 for Quarter. &amp;amp; use that in your set variable.&lt;/P&gt;
&lt;P&gt;FQuarterNum={"&lt;SPAN&gt;&amp;lt;=$(=right(GetFieldSelections(FQuarter),1))&lt;/SPAN&gt;"}&lt;/P&gt;
&lt;P&gt;Try something like this, &amp;amp; Let me know if it worked.&lt;/P&gt;
&lt;P&gt;*Edit*&lt;/P&gt;
&lt;P&gt;Hi, I later realized that getfieldselections won't pass a single selections until Select only one value is enabled for that specific field. Check on that part as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Rohan.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jan 2024 05:35:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Defining-Set-variables-with-functions-in-them/m-p/2163519#M94471</guid>
      <dc:creator>Rohan</dc:creator>
      <dc:date>2024-01-20T05:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Defining Set variables with functions in them</title>
      <link>https://community.qlik.com/t5/App-Development/Defining-Set-variables-with-functions-in-them/m-p/2163994#M94518</link>
      <description>&lt;P&gt;Hi Rohan,&lt;/P&gt;
&lt;P&gt;This made alot of sense why it wasnt working. thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2024 16:57:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Defining-Set-variables-with-functions-in-them/m-p/2163994#M94518</guid>
      <dc:creator>waleeed_mahmood</dc:creator>
      <dc:date>2024-01-22T16:57:30Z</dc:date>
    </item>
  </channel>
</rss>

