<?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: Difference in behavior of numeric-format between pick-match and if-statement in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2057921#M86887</link>
    <description>&lt;P&gt;Issue resolved in Qlik Sense SaaS, please refer to below release notes&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A href="https://community.qlik.com/t5/Release-Notes/Qlik-Cloud-Release-Notes-March-2023/ta-p/2043333" target="_blank"&gt;https://community.qlik.com/t5/Release-Notes/Qlik-Cloud-Release-Notes-March-2023/ta-p/2043333&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;For Qlik Sense Enterprise on Windows, the issue will be solved in next major release&lt;/P&gt;</description>
    <pubDate>Thu, 06 Apr 2023 11:27:11 GMT</pubDate>
    <dc:creator>Chetan_MN</dc:creator>
    <dc:date>2023-04-06T11:27:11Z</dc:date>
    <item>
      <title>Difference in behavior of numeric-format between pick-match and if-statement</title>
      <link>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2031599#M84969</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Having two expressions doing the same one using pick-match and the other if.&lt;/P&gt;
&lt;P&gt;I cannot explain why this two expressions differ in the way the y-axis is formatted.&lt;/P&gt;
&lt;P&gt;When using pick-match any chart in Qlik Sense cloud or on windows Nov 2022 SR1 is stuck in the first available num-format given in the expression.&lt;/P&gt;
&lt;P&gt;The calculation do change when selecting different alternatives&lt;/P&gt;
&lt;P&gt;Here is the script. App is uploaded as well&lt;/P&gt;
&lt;P&gt;Adding the expressions directly in the charts gives same behavior.&lt;/P&gt;
&lt;P&gt;Any suggestions on what is happening?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DummyData:
Load * Inline [
value
0.42
];

Set vShowExprLabel = '42%'; //Default value
Set vShowExprValues = 42%|4.20; 

//this expression will swap between the expressions but always have an y-axis set to %
Set vExpr1 = 
Pick(Match(vShowExprLabel,'42%','4.20')	
    ,num(sum(value),'0%')
    ,num(sum(value*10),'# ##0,00')
);

//This will work as expected
Set vExpr3 = 
if(vShowExprLabel='42%'	
    ,num(sum(value),'0%')
    ,num(sum(value*10),'# ##0,00')   
);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&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="andy_0-1675088588154.png" style="width: 613px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/99159i8E12643B438B77A3/image-dimensions/613x305?v=v2" width="613" height="305" role="button" title="andy_0-1675088588154.png" alt="andy_0-1675088588154.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="andy_1-1675088629831.png" style="width: 646px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/99160i15DAF4063CE53129/image-dimensions/646x318?v=v2" width="646" height="318" role="button" title="andy_1-1675088629831.png" alt="andy_1-1675088629831.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 14:42:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2031599#M84969</guid>
      <dc:creator>andy</dc:creator>
      <dc:date>2023-01-30T14:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in behavior of numeric-format between pick-match and if-statement</title>
      <link>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2031642#M84972</link>
      <description>&lt;P&gt;What happens if you reverse the if-query to:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Set vExpr3 = 
if(vShowExprLabel='4.20'	
    ,num(sum(value*10),'# ##0,00')   
    ,num(sum(value),'0%')
);&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;I could imagine that the if-loop behaved now like the pick(match()). If so it means that '4.20' isn't identically to your calling-value, for example because this value is a number and your query expects a string.&lt;/P&gt;
&lt;P&gt;Even if both values (querying + calling) are numeric a comparing of a binary-number against a decimal-number could fail because a binary system hasn't always an equivalent value. You may try a check against the number by showing more digits. It may result in something like: 4.1999999999999 instead of 4.2.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 15:20:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2031642#M84972</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-01-30T15:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in behavior of numeric-format between pick-match and if-statement</title>
      <link>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2031647#M84973</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Before I&amp;nbsp; hade two strings Exp1 and Exp2 and that gave the same behavior and the condition does work since the value does change with a factor 10. It is only the num-format that doesn't change when doing it with pick-match. So the pick-match is picking the correct expression.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 15:27:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2031647#M84973</guid>
      <dc:creator>andy</dc:creator>
      <dc:date>2023-01-30T15:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in behavior of numeric-format between pick-match and if-statement</title>
      <link>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2031680#M84975</link>
      <description>&lt;P&gt;If your vExpr1 is used in a straight table it works, and if the expression is split into 2 picks, one for value and one for format it also works.&lt;/P&gt;
&lt;P&gt;Set vExpr2 = &lt;BR /&gt;num(&lt;BR /&gt;Pick(Match(vShowExprLabel,'42%','4.20') &lt;BR /&gt;,sum(value*10)&lt;BR /&gt;,sum(value)),&lt;BR /&gt;&lt;BR /&gt;Pick(Match(vShowExprLabel,'42%','4.20') &lt;BR /&gt;,'# ##0,00'&lt;BR /&gt;,'0%')&lt;BR /&gt;);&lt;/P&gt;
&lt;P&gt;Looks like the bar chart is the bad guy here.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 16:05:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2031680#M84975</guid>
      <dc:creator>jbhappysocks</dc:creator>
      <dc:date>2023-01-30T16:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in behavior of numeric-format between pick-match and if-statement</title>
      <link>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2031686#M84976</link>
      <description>&lt;P&gt;Ok. this looks really strange ... Before playing further I suggest to look again to the object-properties if they are really identically and/or swapping the expression between them and/or creating a complete new chart from the scratch - just to exclude an object-corruption or having overseen any setting.&lt;/P&gt;
&lt;P&gt;If the issue remained you may extend your logic to an appropriate rounding-function, like:&lt;/P&gt;
&lt;P&gt;round(sum(value), 0.01)&lt;/P&gt;
&lt;P&gt;to prevent the above mentioned binary-system-stuff.&lt;/P&gt;
&lt;P&gt;Another thought goes to num() which is here applied with only one parameter which in my experience only worked if the used thousand + decimal delimiter are identically with the default-settings. If not the second and third parameter of num() needs to specified, too.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 16:16:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2031686#M84976</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-01-30T16:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in behavior of numeric-format between pick-match and if-statement</title>
      <link>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2031713#M84978</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I also thought it might be bad luck with an object so I created the basic app that I attached to the first post from scratch with the same issue. My real app has the issue within a line-chart.&lt;/P&gt;
&lt;P&gt;Regarding your binary-stuff suggestion I think you are missing that the condition is working, it does select the appropriate part, it is just the formatting that doesn't have effect in the bar-, combo- or line-chart but it works correct when used in a straight table.&lt;/P&gt;
&lt;P&gt;I now tried adding more parameters to the num() but with same result.&lt;/P&gt;
&lt;P&gt;I'll add a support-case&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 17:12:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2031713#M84978</guid>
      <dc:creator>andy</dc:creator>
      <dc:date>2023-01-30T17:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in behavior of numeric-format between pick-match and if-statement</title>
      <link>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2031909#M85003</link>
      <description>&lt;P&gt;I think you are right by regarding the issue as a bug and creating a support-case for it because IMO the evaluation&amp;nbsp; of such expression should be equally regardless if they is called directly respectively within a cell or within any other meta-data layer like the axis.&lt;/P&gt;
&lt;P&gt;Nevertheless I tried to give hints to find a workaround assuming possible causes for such a different behaviour ... and in this regard you may play a bit more with it and simplifying your approach with something like: if(1 = 1, num(0.5), num(0.5, '0.0%')) or similar ... maybe also combining num(num#()) and/or setting min/max/steps for axis and other settings ...&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 07:40:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2031909#M85003</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-01-31T07:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in behavior of numeric-format between pick-match and if-statement</title>
      <link>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2031920#M85005</link>
      <description>&lt;P&gt;I changed the condition to&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Set vShowExprLabel = 'percentage'; //Default value&lt;BR /&gt;Set vShowExprValues = decimal|percentage;&lt;/P&gt;
&lt;P&gt;To avoid any suspicion this has anything to do with numbers in the if-statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also added a 4:th expression that changed the order in the first pick, so decimal comes before percentage.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Percentage selected: All expressions correct in the straight table. All bar charts shows correct values, but the last added expression where decimal comes first in the pick statement shows incorrect format.&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="jbhappysocks_1-1675152186646.png" style="width: 723px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/99219iC7D5175D8FB8C59C/image-dimensions/723x317?v=v2" width="723" height="317" role="button" title="jbhappysocks_1-1675152186646.png" alt="jbhappysocks_1-1675152186646.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Decimal selected:&amp;nbsp;All expressions correct in the straight table. All bar charts shows correct values, but the first added expression where percentage comes first in the pick statement shows incorrect format.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jbhappysocks_2-1675152296667.png" style="width: 725px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/99220i0CB5D3F6595CC539/image-dimensions/725x310?v=v2" width="725" height="310" role="button" title="jbhappysocks_2-1675152296667.png" alt="jbhappysocks_2-1675152296667.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The expression where the pick is split in two (vExpr2) shows expected outcome for both Decimal and Percentage.&lt;/P&gt;
&lt;P&gt;Even if workarounds with&amp;nbsp;&lt;SPAN&gt;num#() might exist it shouldn't be needed here. This just look wrong.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 08:08:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2031920#M85005</guid>
      <dc:creator>jbhappysocks</dc:creator>
      <dc:date>2023-01-31T08:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in behavior of numeric-format between pick-match and if-statement</title>
      <link>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2042273#M85827</link>
      <description>&lt;P&gt;Got this from support&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"bug ID QB-18156"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Feb 2023 18:06:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2042273#M85827</guid>
      <dc:creator>andy</dc:creator>
      <dc:date>2023-02-26T18:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in behavior of numeric-format between pick-match and if-statement</title>
      <link>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2057921#M86887</link>
      <description>&lt;P&gt;Issue resolved in Qlik Sense SaaS, please refer to below release notes&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A href="https://community.qlik.com/t5/Release-Notes/Qlik-Cloud-Release-Notes-March-2023/ta-p/2043333" target="_blank"&gt;https://community.qlik.com/t5/Release-Notes/Qlik-Cloud-Release-Notes-March-2023/ta-p/2043333&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;For Qlik Sense Enterprise on Windows, the issue will be solved in next major release&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 11:27:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Difference-in-behavior-of-numeric-format-between-pick-match-and/m-p/2057921#M86887</guid>
      <dc:creator>Chetan_MN</dc:creator>
      <dc:date>2023-04-06T11:27:11Z</dc:date>
    </item>
  </channel>
</rss>

