<?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 Set expressions working correctly, but give &amp;quot;Error in expression&amp;quot; when included in an If statement in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-expressions-working-correctly-but-give-quot-Error-in/m-p/2502512#M103464</link>
    <description>&lt;P&gt;Here is the entire expression:&lt;/P&gt;
&lt;P&gt;=If((vMeasure) = 'EquivPrice',&lt;BR /&gt;(Num(Sum({&amp;lt;ShipDate_DayOfWeek={'Mon'},Week={'$(vWeek)'},ShipYear={'$(=$(vYear))'}&amp;gt;}ExtendedPrice) / Sum({&amp;lt;ShipDate_DayOfWeek={'Mon'},Week={'$(vWeek)'},ShipYear={'$(=$(vYear))'}&amp;gt;}EquivalentUnits),'$##.00'))&lt;BR /&gt;,&lt;BR /&gt;If((vMeasure) = 'CartonPrice',&lt;BR /&gt;(Num(Sum({&amp;lt;ShipDate_DayOfWeek={'Mon'},Week={'$(vWeek)'},ShipYear={'$(=$(vYear))'}&amp;gt;}ExtendedPrice) / Sum({&amp;lt;ShipDate_DayOfWeek={'Mon'},Week={'$(vWeek)'},ShipYear={'$(=$(vYear))'}&amp;gt;}CartonEquiv),'$##.00')),&lt;BR /&gt;(Num(Sum({&amp;lt;ShipDate_DayOfWeek={'Mon'},Week={'$(vWeek)'},ShipYear={'$(=$(vYear))'}&amp;gt;}$(vMeasure)),'#,##0'))&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;Here is how it evaluates in the error panel:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mikegrattan_0-1737569610067.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/176777iBC4039CC2DB101DC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mikegrattan_0-1737569610067.png" alt="mikegrattan_0-1737569610067.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It appears that all variables are evaluated correctly, and when I get out of the Edit mode, the results look good in the table, even after changing multiple variables to other values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to correct this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jan 2025 18:17:08 GMT</pubDate>
    <dc:creator>mikegrattan</dc:creator>
    <dc:date>2025-01-22T18:17:08Z</dc:date>
    <item>
      <title>Set expressions working correctly, but give "Error in expression" when included in an If statement</title>
      <link>https://community.qlik.com/t5/App-Development/Set-expressions-working-correctly-but-give-quot-Error-in/m-p/2502512#M103464</link>
      <description>&lt;P&gt;Here is the entire expression:&lt;/P&gt;
&lt;P&gt;=If((vMeasure) = 'EquivPrice',&lt;BR /&gt;(Num(Sum({&amp;lt;ShipDate_DayOfWeek={'Mon'},Week={'$(vWeek)'},ShipYear={'$(=$(vYear))'}&amp;gt;}ExtendedPrice) / Sum({&amp;lt;ShipDate_DayOfWeek={'Mon'},Week={'$(vWeek)'},ShipYear={'$(=$(vYear))'}&amp;gt;}EquivalentUnits),'$##.00'))&lt;BR /&gt;,&lt;BR /&gt;If((vMeasure) = 'CartonPrice',&lt;BR /&gt;(Num(Sum({&amp;lt;ShipDate_DayOfWeek={'Mon'},Week={'$(vWeek)'},ShipYear={'$(=$(vYear))'}&amp;gt;}ExtendedPrice) / Sum({&amp;lt;ShipDate_DayOfWeek={'Mon'},Week={'$(vWeek)'},ShipYear={'$(=$(vYear))'}&amp;gt;}CartonEquiv),'$##.00')),&lt;BR /&gt;(Num(Sum({&amp;lt;ShipDate_DayOfWeek={'Mon'},Week={'$(vWeek)'},ShipYear={'$(=$(vYear))'}&amp;gt;}$(vMeasure)),'#,##0'))&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;Here is how it evaluates in the error panel:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mikegrattan_0-1737569610067.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/176777iBC4039CC2DB101DC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mikegrattan_0-1737569610067.png" alt="mikegrattan_0-1737569610067.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It appears that all variables are evaluated correctly, and when I get out of the Edit mode, the results look good in the table, even after changing multiple variables to other values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to correct this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 18:17:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-expressions-working-correctly-but-give-quot-Error-in/m-p/2502512#M103464</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2025-01-22T18:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Set expressions working correctly, but give "Error in expression" when included in an If statement</title>
      <link>https://community.qlik.com/t5/App-Development/Set-expressions-working-correctly-but-give-quot-Error-in/m-p/2502521#M103467</link>
      <description>&lt;P&gt;Updated it as follows and now it works:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;=If((vMeasure) = 'EquivPrice',&lt;BR /&gt;(Num(Sum({&amp;lt;ShipDate_DayOfWeek={'Mon'},Week={'$(vWeek)'},ShipYear={'$(vYear)'}&amp;gt;}ExtendedPrice) / Sum({&amp;lt;ShipDate_DayOfWeek={'Mon'},Week={'$(vWeek)'},ShipYear={'$(vYear)'}&amp;gt;}EquivalentUnits),'$##.00'))&lt;BR /&gt;,&lt;BR /&gt;If((vMeasure) = 'CartonPrice',&lt;BR /&gt;(Num(Sum({&amp;lt;ShipDate_DayOfWeek={'Mon'},Week={'$(vWeek)'},ShipYear={'$(vYear)'}&amp;gt;}ExtendedPrice) / Sum({&amp;lt;ShipDate_DayOfWeek={'Mon'},Week={'$(vWeek)'},ShipYear={'$(vYear)'}&amp;gt;}CartonEquiv),'$##.00')),&lt;BR /&gt;(Num(Sum({&amp;lt;ShipDate_DayOfWeek={'Mon'},[Week]={'$(vWeek)'},ShipYear={'$(vYear)'}&amp;gt;}$(vMeasure)),'#,##0'))&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 19:09:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-expressions-working-correctly-but-give-quot-Error-in/m-p/2502521#M103467</guid>
      <dc:creator>mikegrattan</dc:creator>
      <dc:date>2025-01-22T19:09:54Z</dc:date>
    </item>
  </channel>
</rss>

