<?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: Expansion with SubField creating error in If Statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expansion-with-SubField-creating-error-in-If-Statement/m-p/1594404#M737958</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I'd suggest you to share an example app.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another thing is to try to evaluate the expressions in text boxes separately: eg&lt;/P&gt;&lt;PRE&gt;SubField(Concat(%vsExprR.Expansion,'|'),'|',1)&lt;/PRE&gt;&lt;P&gt;for one&amp;nbsp;&lt;/P&gt;&lt;P&gt;and&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SubField(Concat(%vsExprL.Expansion,'|'),'|',2)&lt;/PRE&gt;&lt;P&gt;for another.&lt;/P&gt;&lt;P&gt;It might help you to understand what exactly is happening, when you make your selections&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jun 2019 05:20:25 GMT</pubDate>
    <dc:creator>SergeyMak</dc:creator>
    <dc:date>2019-06-21T05:20:25Z</dc:date>
    <item>
      <title>Expansion with SubField creating error in If Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Expansion-with-SubField-creating-error-in-If-Statement/m-p/1594305#M737957</link>
      <description>&lt;P&gt;My If statement feels like it should be pretty simple, but my second SubField expansion is breaking the expression, and I'm assuming this is because I'm using $(=) instead of $(), but I'm not sure how else to pull in the expansion.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;If(GetSelectedCount(%vsExprR.Favorites)&amp;gt;0,$(=SubField(Concat(%vsExprR.Expansion,'|'),'|',1)),  
//Any Selections for Right Axis
If(GetSelectedCount(%vsExprL.Favorites)&amp;gt;1,$(=SubField(Concat(%vsExprL.Expansion,'|'),'|',2)),
//More than Two Selections for Left
$(mPolicyCount)))
//Anything Else​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Essentially this code is for the expression portion of a list box.&amp;nbsp; There are right and left list boxes.&amp;nbsp; The list boxes changes based on user selections.&amp;nbsp; They select a field they want to analyze and then they can choose a "Left" expression(s) and/or a "Right" expression(s).&amp;nbsp; The ExprL table has expression names in one field and dollar sign expansions in another.&amp;nbsp; These expansions correlate with expressions I already have stored as variables.&amp;nbsp; So when the user selects "Sum of Premium" this would link to $(vSumPremium), which is what I would want to use as the expression.&lt;/P&gt;&lt;P&gt;This works fine except when only one value is selected for the ExprL.Favorites, this means only one value for ExprL.Expansion is available, so evaluating for SubField number 2 creates an error in my expression.&amp;nbsp; It shows up as "-" in the list box, and when thrown into a text box returns "Error: Error in expression: ')' expected".&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I solved this by choosing the '2' in the second SubField to '-1', but would there be a way to get this to work while still pulling the second SubField?&amp;nbsp; Picture Below&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="Broken List Box.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/14125i779FC423561801CA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Broken List Box.PNG" alt="Broken List Box.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:13:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expansion-with-SubField-creating-error-in-If-Statement/m-p/1594305#M737957</guid>
      <dc:creator>Jagsfan82</dc:creator>
      <dc:date>2024-11-16T03:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Expansion with SubField creating error in If Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Expansion-with-SubField-creating-error-in-If-Statement/m-p/1594404#M737958</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I'd suggest you to share an example app.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another thing is to try to evaluate the expressions in text boxes separately: eg&lt;/P&gt;&lt;PRE&gt;SubField(Concat(%vsExprR.Expansion,'|'),'|',1)&lt;/PRE&gt;&lt;P&gt;for one&amp;nbsp;&lt;/P&gt;&lt;P&gt;and&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SubField(Concat(%vsExprL.Expansion,'|'),'|',2)&lt;/PRE&gt;&lt;P&gt;for another.&lt;/P&gt;&lt;P&gt;It might help you to understand what exactly is happening, when you make your selections&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 05:20:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expansion-with-SubField-creating-error-in-If-Statement/m-p/1594404#M737958</guid>
      <dc:creator>SergeyMak</dc:creator>
      <dc:date>2019-06-21T05:20:25Z</dc:date>
    </item>
  </channel>
</rss>

