<?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 $ Expansion inside $Expansion in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expansion-inside-Expansion/m-p/200605#M59073</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response Onder, unfortunately this doesn't work, it doesn't evaluate the $expansion once it's put into the chart as an expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Apr 2010 14:02:57 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-04-01T14:02:57Z</dc:date>
    <item>
      <title>$ Expansion inside $Expansion</title>
      <link>https://community.qlik.com/t5/QlikView/Expansion-inside-Expansion/m-p/200603#M59071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Folks&lt;/P&gt;&lt;P&gt;I wonder if anybody can help with this.&lt;/P&gt;&lt;P&gt;I have a variable called vCompDate which is set as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;SET vCompDate = "=GetFieldSelections(DT_ComparisonDate)";&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;When I use this inside an expression in a chart (for example IF DT_RepDate = $(vCompDate) .........) then it evaluates the dollar expansion and the expression becomes IF DT_RepDate = "31-Dec-08" .......... which is exactly what I need.&lt;/P&gt;&lt;P&gt;Now, I want to use this dollar expansion inside another variable which is going to be used as a dollar expansion, so I set a variable like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;SET vComplexValue = "=Sum(if(DT_RepDate=$(vCompDate),Cost,Price))"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;However, my problem now is that when I add =$(vComplexValue) into a chart, the expression is evaluated as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;=Sum(if(DT_RepDate="=GetFieldSelections(DT_ComparisonDate)",Cost,Price))&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;This expression doesn't work, because the embedded dollar expansion is not being evaluated.&lt;/P&gt;&lt;P&gt;Any thoughts on this, I'm really banging my head against a brick wall here.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Apr 2010 12:02:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expansion-inside-Expansion/m-p/200603#M59071</guid>
      <dc:creator />
      <dc:date>2010-04-01T12:02:18Z</dc:date>
    </item>
    <item>
      <title>$ Expansion inside $Expansion</title>
      <link>https://community.qlik.com/t5/QlikView/Expansion-inside-Expansion/m-p/200604#M59072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Could you change vCompdate like that ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;SET vCompDate = "GetFieldSelections(DT_ComparisonDate)";&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Önder&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Apr 2010 13:49:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expansion-inside-Expansion/m-p/200604#M59072</guid>
      <dc:creator />
      <dc:date>2010-04-01T13:49:09Z</dc:date>
    </item>
    <item>
      <title>$ Expansion inside $Expansion</title>
      <link>https://community.qlik.com/t5/QlikView/Expansion-inside-Expansion/m-p/200605#M59073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response Onder, unfortunately this doesn't work, it doesn't evaluate the $expansion once it's put into the chart as an expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Apr 2010 14:02:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expansion-inside-Expansion/m-p/200605#M59073</guid>
      <dc:creator />
      <dc:date>2010-04-01T14:02:57Z</dc:date>
    </item>
    <item>
      <title>$ Expansion inside $Expansion</title>
      <link>https://community.qlik.com/t5/QlikView/Expansion-inside-Expansion/m-p/200606#M59074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried the following script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vCompDateExp = "GetFieldSelections(DT_ComparisonDate)";&lt;/P&gt;&lt;P&gt;SET vCompDate = "=$(vCompDateExp)";&lt;/P&gt;&lt;P&gt;SET vComplexValueA = "=Sum(if(DT_RepDate=$(vCompDate),Cost,Price))";&lt;/P&gt;&lt;P&gt;SET vComplexValueB = "=Sum(if(DT_RepDate=$(vCompDateExp),Cost,Price))";&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;and I get the following output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vComplexValueB "=Sum(if(DT_RepDate=GetFieldSelections(DT_ComparisonDate),Cost,Price))"&lt;/P&gt;&lt;P&gt;vComplexValueA "=Sum(if(DT_RepDate==GetFieldSelections(DT_ComparisonDate),Cost,Price))"&lt;/P&gt;&lt;P&gt;vCompDateExp "GetFieldSelections(DT_ComparisonDate)"&lt;/P&gt;&lt;P&gt;vCompDate "=GetFieldSelections(DT_ComparisonDate)"&lt;/P&gt;&lt;P&gt;vComplexValueA expands with 2 equal symbols but without the quotes you're seeing. I think that if you need to include the equal symbol you must use 2 different variables. Using the first one to build the second. Does it help?&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Apr 2010 16:21:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expansion-inside-Expansion/m-p/200606#M59074</guid>
      <dc:creator />
      <dc:date>2010-04-01T16:21:53Z</dc:date>
    </item>
    <item>
      <title>$ Expansion inside $Expansion</title>
      <link>https://community.qlik.com/t5/QlikView/Expansion-inside-Expansion/m-p/200607#M59075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I would also suggest to remove the leading = in the variables:&lt;/P&gt;&lt;P&gt;SET v1 = "Now()";&lt;BR /&gt;SET v2 = "date($(v1),'DD.MM.YYYY')";&lt;/P&gt;&lt;P&gt;The expression (in a text box) =$(v2) calculates correctly.&lt;/P&gt;&lt;P&gt;I have not tested it, but if the = is needed, something like $(=$(v2)) could work ...&lt;/P&gt;&lt;P&gt;hth,&lt;BR /&gt;Thilo &lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Apr 2010 18:21:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expansion-inside-Expansion/m-p/200607#M59075</guid>
      <dc:creator />
      <dc:date>2010-04-01T18:21:51Z</dc:date>
    </item>
    <item>
      <title>$ Expansion inside $Expansion</title>
      <link>https://community.qlik.com/t5/QlikView/Expansion-inside-Expansion/m-p/200608#M59076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone&lt;/P&gt;&lt;P&gt;Thanks to all of you who replied to this, I have used most of your suggestions and come up with a solution that works, the key bit of information was the replacing of $ symbols with chr(36) as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;SET vCompDate = "=GetFieldSelections(DT_ComparisonDate)";&lt;BR /&gt;LET vPriorInvCap = 'Sum({$&amp;lt;DT_ReportDate={"' &amp;amp; chr(36) &amp;amp; '(vCompDate)"},DT_ComparisonDate={"*"}&amp;gt;}_rCost+_rUnfunded+_rDeferred)+(Sum({$&amp;lt;DT_ReportDate={"' &amp;amp; chr(36) &amp;amp; '(vCompDate)"},DT_ComparisonDate={"*"}&amp;gt;}_rUnfunded_PShop+_rDeferred_PShop)*Max({$&amp;lt;DT_ReportDate={$(vCompDate)},DT_ComparisonDate={"*"}&amp;gt;}FX_toUSD_Inv_RepDate))';&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;You'll notice though, that I'm not replacing all of the $ symbols (a mistake I made when first trying this), only the $ expansion symbols are replaced, the above solution works really well and certainly makes life very much easier when modifying and using these complex expressions.&lt;/P&gt;&lt;P&gt;Thanks to everyone for getting involved in this.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Apr 2010 09:13:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expansion-inside-Expansion/m-p/200608#M59076</guid>
      <dc:creator />
      <dc:date>2010-04-06T09:13:46Z</dc:date>
    </item>
  </channel>
</rss>

