<?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: Alt() works differently in script and in front end in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Alt-works-differently-in-script-and-in-front-end/m-p/1220192#M623787</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Marcus&lt;/P&gt;&lt;P&gt;That's my interpretation of the behaviour too (and that's why Let x = 1 does not have the problem) - it just seems inconsistent to me and it caused a hard to track down bug. IMO Alt() should act like IsNum() does and be the same in the script and in the front end.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Jan 2017 08:10:53 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2017-01-10T08:10:53Z</dc:date>
    <item>
      <title>Alt() works differently in script and in front end</title>
      <link>https://community.qlik.com/t5/QlikView/Alt-works-differently-in-script-and-in-front-end/m-p/1220190#M623785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Consider the following script fragment:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14840303339583100" jivemacro_uid="_14840303339583100"&gt;
&lt;P&gt;Set x1 = 1;&lt;/P&gt;
&lt;P&gt;Let x2 = 2;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Let z1 = Alt(x1, 100);&lt;/P&gt;
&lt;P&gt;Let z2 = Alt(x2, 200);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Let e1 = IsNum(x1);&lt;/P&gt;
&lt;P&gt;Let e2 = IsNum(x2);&lt;/P&gt;



&lt;/PRE&gt;&lt;P&gt;This produces the following results:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="148893" alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/148893_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Notice that the Alt(x1, 100) considered x1 to be non-numeric, whereas IsNum(x1) sees x1 as numeric. Furthermore, in the front end, we get this:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="148894" alt="Capture.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/148894_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;So x1 is being seen as numeric by Alt() and IsNum() in the front end expressions, and in the script it is considered numeric by IsNum(), but non-numeric by Alt()&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the case where this behaviour was observed, the Set x1&amp;nbsp; = 1 expression is dynamically generated from a configuration file. The Alt() was required to provide a default if the configuration file did not have a definition of x1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The workaround is to &lt;SPAN style="font-size: 13.3333330154419px;"&gt;change the config loader to generate the values with Let, but if that is not an option, &lt;/SPAN&gt;use an expansion:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14840308575075054 jive_text_macro" jivemacro_uid="_14840308575075054"&gt;
&lt;P&gt;Let z1 = Alt($(x1), 100);&lt;/P&gt;



&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Version 11.2 SR15 11.20.13405.0&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2017 06:51:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Alt-works-differently-in-script-and-in-front-end/m-p/1220190#M623785</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2017-01-10T06:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Alt() works differently in script and in front end</title>
      <link>https://community.qlik.com/t5/QlikView/Alt-works-differently-in-script-and-in-front-end/m-p/1220191#M623786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure if this behaviour is really unexpected then &lt;STRONG&gt;Set x1 = 1&lt;/STRONG&gt;; assigned a string to the variable and &lt;STRONG&gt;Let x2 = 2;&lt;/STRONG&gt; creates an dual-value with 2 as string and 2 as numeric value. Therefore differ the alt-results by the z-variables. And I think isnum() instead will be evaluate it's input-value and at first check if the value is an (valid) dual-value and if it's not then it will check if the string-representation could be evaluated as number - and in this case both checks on the e-variables will be true.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further I think the front-end treated the x1 variable as number because it sees it just as&lt;STRONG&gt; 1&lt;/STRONG&gt; and not as '1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2017 07:30:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Alt-works-differently-in-script-and-in-front-end/m-p/1220191#M623786</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2017-01-10T07:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Alt() works differently in script and in front end</title>
      <link>https://community.qlik.com/t5/QlikView/Alt-works-differently-in-script-and-in-front-end/m-p/1220192#M623787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Marcus&lt;/P&gt;&lt;P&gt;That's my interpretation of the behaviour too (and that's why Let x = 1 does not have the problem) - it just seems inconsistent to me and it caused a hard to track down bug. IMO Alt() should act like IsNum() does and be the same in the script and in the front end.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2017 08:10:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Alt-works-differently-in-script-and-in-front-end/m-p/1220192#M623787</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2017-01-10T08:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Alt() works differently in script and in front end</title>
      <link>https://community.qlik.com/t5/QlikView/Alt-works-differently-in-script-and-in-front-end/m-p/1220193#M623788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe &lt;A href="https://community.qlik.com/qlik-users/4003"&gt;hic&lt;/A&gt; could give some backgrounds if it's behaved expectedly or not and why there are differences between alt() and isnum().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2017 09:04:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Alt-works-differently-in-script-and-in-front-end/m-p/1220193#M623788</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2017-01-10T09:04:38Z</dc:date>
    </item>
  </channel>
</rss>

