<?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 an expression with alternating states in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/expansion-inside-an-expression-with-alternating-states/m-p/1907925#M74835</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;i have a language field and altenating states.&amp;nbsp; ive set the alternate state of the object to use STATE1 for example and have the following measure:&lt;BR /&gt;&lt;BR /&gt;=concat(distinct Mesure,'|',metric_sort_order_$(=only(language_code))) &amp;amp; '|'&lt;/P&gt;
&lt;P&gt;for STATE1, i selected the lang_code = fr, but for default state&amp;nbsp; lang_code=en&lt;/P&gt;
&lt;P&gt;notice the embedded $expression.&amp;nbsp; what i am observing is that the $expression is evaluated using the default state (en) even if the object were set to use the state STATE1. so this evaluates to&lt;/P&gt;
&lt;P&gt;=concat(distinct Mesure,'|',metric_sort_order_en) &amp;amp; '|' - which is for default state&lt;/P&gt;
&lt;P&gt;when i wanted it to be&amp;nbsp;&lt;/P&gt;
&lt;P&gt;=concat(distinct Mesure,'|',metric_sort_order_fr) &amp;amp; '|'&amp;nbsp; - that is for STATE1&lt;/P&gt;
&lt;P&gt;if i take this out and add the measure&lt;/P&gt;
&lt;P&gt;=only(language_code)&lt;/P&gt;
&lt;P&gt;it properly evaluates to the correct value for the state (fr)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i do understand that i can add {STATE1} in the expression.&amp;nbsp; but for my purpose, i wanted it to inherit the state of the object.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;anyone with thoughts on whats going on?&amp;nbsp; the doc says:&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="edwin_0-1647905167755.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/75012iBCC10F056FBEE122/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_0-1647905167755.png" alt="edwin_0-1647905167755.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;P&gt;edwin&lt;/P&gt;</description>
    <pubDate>Mon, 21 Mar 2022 23:28:14 GMT</pubDate>
    <dc:creator>edwin</dc:creator>
    <dc:date>2022-03-21T23:28:14Z</dc:date>
    <item>
      <title>$expansion inside an expression with alternating states</title>
      <link>https://community.qlik.com/t5/App-Development/expansion-inside-an-expression-with-alternating-states/m-p/1907925#M74835</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;i have a language field and altenating states.&amp;nbsp; ive set the alternate state of the object to use STATE1 for example and have the following measure:&lt;BR /&gt;&lt;BR /&gt;=concat(distinct Mesure,'|',metric_sort_order_$(=only(language_code))) &amp;amp; '|'&lt;/P&gt;
&lt;P&gt;for STATE1, i selected the lang_code = fr, but for default state&amp;nbsp; lang_code=en&lt;/P&gt;
&lt;P&gt;notice the embedded $expression.&amp;nbsp; what i am observing is that the $expression is evaluated using the default state (en) even if the object were set to use the state STATE1. so this evaluates to&lt;/P&gt;
&lt;P&gt;=concat(distinct Mesure,'|',metric_sort_order_en) &amp;amp; '|' - which is for default state&lt;/P&gt;
&lt;P&gt;when i wanted it to be&amp;nbsp;&lt;/P&gt;
&lt;P&gt;=concat(distinct Mesure,'|',metric_sort_order_fr) &amp;amp; '|'&amp;nbsp; - that is for STATE1&lt;/P&gt;
&lt;P&gt;if i take this out and add the measure&lt;/P&gt;
&lt;P&gt;=only(language_code)&lt;/P&gt;
&lt;P&gt;it properly evaluates to the correct value for the state (fr)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i do understand that i can add {STATE1} in the expression.&amp;nbsp; but for my purpose, i wanted it to inherit the state of the object.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;anyone with thoughts on whats going on?&amp;nbsp; the doc says:&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="edwin_0-1647905167755.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/75012iBCC10F056FBEE122/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_0-1647905167755.png" alt="edwin_0-1647905167755.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;P&gt;edwin&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 23:28:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/expansion-inside-an-expression-with-alternating-states/m-p/1907925#M74835</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2022-03-21T23:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: $expansion inside an expression with alternating states</title>
      <link>https://community.qlik.com/t5/App-Development/expansion-inside-an-expression-with-alternating-states/m-p/1907950#M74839</link>
      <description>&lt;P&gt;I do not see the same behavior as you.&amp;nbsp; In my similar test the $() expression is evaluated in the state of the containing object.&amp;nbsp; What version are you using and can you upload a small example that demonstrates the problem?&lt;/P&gt;
&lt;P&gt;-Rob&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 02:25:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/expansion-inside-an-expression-with-alternating-states/m-p/1907950#M74839</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2022-03-22T02:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: $expansion inside an expression with alternating states</title>
      <link>https://community.qlik.com/t5/App-Development/expansion-inside-an-expression-with-alternating-states/m-p/1907954#M74840</link>
      <description>&lt;P&gt;My test as well evaluates in the state of the containing object but I see wrong conversion in the expression editor, my expression evaluates for 'fr' but expression editor shows 'en', but I have seen such conversion bugs in the expression editor bottom section in the past as well.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Digvijay_Singh_0-1647919548020.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/75020iE5C1CDB5BD15B7F3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Digvijay_Singh_0-1647919548020.png" alt="Digvijay_Singh_0-1647919548020.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 03:27:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/expansion-inside-an-expression-with-alternating-states/m-p/1907954#M74840</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2022-03-22T03:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: $expansion inside an expression with alternating states</title>
      <link>https://community.qlik.com/t5/App-Development/expansion-inside-an-expression-with-alternating-states/m-p/1908328#M74875</link>
      <description>&lt;P&gt;Thank you very much for the swift responses.&amp;nbsp; i did a little more testing after i saw your messages and realized we were thrown off by the message at the bottom of the xpression builder.&amp;nbsp; in this example, i selected a language (fr) for state STATE1:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_0-1647970727596.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/75073i561A0A3D5064E1A4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_0-1647970727596.png" alt="edwin_0-1647970727596.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;then i figured select something for the default state (en):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_1-1647970802922.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/75074iDF7B15A5270D34A2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_1-1647970802922.png" alt="edwin_1-1647970802922.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this means the expression checker uses the default state even if you selected a state for the object.&amp;nbsp; so, going back, even if it says there is an error in the expression checker, we went ahead and tested without any selection for default state and it is working fine.&lt;/P&gt;
&lt;P&gt;thanks,&lt;/P&gt;
&lt;P&gt;edwin&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 17:41:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/expansion-inside-an-expression-with-alternating-states/m-p/1908328#M74875</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2022-03-22T17:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: $expansion inside an expression with alternating states</title>
      <link>https://community.qlik.com/t5/App-Development/expansion-inside-an-expression-with-alternating-states/m-p/1908330#M74876</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;
&lt;P&gt;yes this was my observation.&amp;nbsp; saw this after i posted my reply&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;P&gt;edwin&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 17:43:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/expansion-inside-an-expression-with-alternating-states/m-p/1908330#M74876</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2022-03-22T17:43:33Z</dc:date>
    </item>
  </channel>
</rss>

