<?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 Expressions nested in other expressions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expressions-nested-in-other-expressions/m-p/1189812#M626717</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello to everyone!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope somebody could help me with the problem I'm facing:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a external .qvs I'm setting the following variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;SET exp1 = Avg({1&amp;lt;Field1={'Value1'},Field2={'$1'}&amp;gt;}Field3);&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;SET exp2 = 'Value2';&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;SET exp3 = ((Sum({&amp;lt;Field3={$1}&amp;gt;}Field4 * Field5))/Sum({&amp;lt;Field3={$1}&amp;gt;}Field6));&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;SET exp4 = &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;If(QV_Show_Time='Quarterly',&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;&amp;nbsp; If($(exp1($(exp2)))&amp;gt;=$(exp3('Value3')),&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;&amp;nbsp; vt_ColorPositive,&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;&amp;nbsp; If($(exp1($(exp2)))&amp;gt;=($(exp3('Value3')) - 0.05) and $(exp1($(exp2)))&amp;lt;$(exp3('Value3')),&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;&amp;nbsp; ' ', &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;vt_ColorNegative)))&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;EM&gt;;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;Where &lt;STRONG&gt;QV_Show_Time &lt;/STRONG&gt;is also a Field, and &lt;STRONG&gt;vt_ColorPositive&lt;/STRONG&gt; and &lt;STRONG&gt;vt_ColorNegative&lt;/STRONG&gt; are colors defined using the RGB() function. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I use the expression &lt;STRONG&gt;'exp4'&lt;/STRONG&gt; to compare two values and change the font color from a straight table. When I copy &lt;STRONG&gt;exp4&lt;/STRONG&gt; to&amp;nbsp; 'Text Color' of the object it works fine. But if that expression is defined outside in a .qvs it doesn't work. I think that there is one ore more expressions that may be are called wrong (maybe using $(=exp)), but I tried almost all and I didn't found the mistake.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll appreciate all the help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Sep 2016 14:46:23 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-09-21T14:46:23Z</dc:date>
    <item>
      <title>Expressions nested in other expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-nested-in-other-expressions/m-p/1189812#M626717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello to everyone!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope somebody could help me with the problem I'm facing:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a external .qvs I'm setting the following variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;SET exp1 = Avg({1&amp;lt;Field1={'Value1'},Field2={'$1'}&amp;gt;}Field3);&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;SET exp2 = 'Value2';&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;SET exp3 = ((Sum({&amp;lt;Field3={$1}&amp;gt;}Field4 * Field5))/Sum({&amp;lt;Field3={$1}&amp;gt;}Field6));&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;SET exp4 = &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;If(QV_Show_Time='Quarterly',&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;&amp;nbsp; If($(exp1($(exp2)))&amp;gt;=$(exp3('Value3')),&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;&amp;nbsp; vt_ColorPositive,&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;&amp;nbsp; If($(exp1($(exp2)))&amp;gt;=($(exp3('Value3')) - 0.05) and $(exp1($(exp2)))&amp;lt;$(exp3('Value3')),&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;&amp;nbsp; ' ', &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;vt_ColorNegative)))&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;EM&gt;;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;Where &lt;STRONG&gt;QV_Show_Time &lt;/STRONG&gt;is also a Field, and &lt;STRONG&gt;vt_ColorPositive&lt;/STRONG&gt; and &lt;STRONG&gt;vt_ColorNegative&lt;/STRONG&gt; are colors defined using the RGB() function. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I use the expression &lt;STRONG&gt;'exp4'&lt;/STRONG&gt; to compare two values and change the font color from a straight table. When I copy &lt;STRONG&gt;exp4&lt;/STRONG&gt; to&amp;nbsp; 'Text Color' of the object it works fine. But if that expression is defined outside in a .qvs it doesn't work. I think that there is one ore more expressions that may be are called wrong (maybe using $(=exp)), but I tried almost all and I didn't found the mistake.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll appreciate all the help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2016 14:46:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-nested-in-other-expressions/m-p/1189812#M626717</guid>
      <dc:creator />
      <dc:date>2016-09-21T14:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Expressions nested in other expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-nested-in-other-expressions/m-p/1189813#M626718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I got it! All I have done is to use '&lt;STRONG&gt;exp4&lt;/STRONG&gt;' as a function, replacing the '&lt;STRONG&gt;exp1&lt;/STRONG&gt;' parameter (&lt;STRONG&gt;$(&lt;/STRONG&gt;&lt;STRONG&gt;exp2)&lt;/STRONG&gt;) with &lt;STRONG&gt;$1&lt;/STRONG&gt; and call the function as following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;$(exp4($(exp2)))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This worked for me. My question is: all expressions using other expressions with parameters, must be paremeterized also with those parameters?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 07:20:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-nested-in-other-expressions/m-p/1189813#M626718</guid>
      <dc:creator />
      <dc:date>2016-09-22T07:20:46Z</dc:date>
    </item>
  </channel>
</rss>

