<?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: Errors when comparing values due to formatting in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Errors-when-comparing-values-due-to-formatting/m-p/573086#M213481</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is KPI1?&lt;/P&gt;&lt;P&gt;It is string or column that contain any value for comparison?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Mar 2014 16:20:34 GMT</pubDate>
    <dc:creator>PrashantSangle</dc:creator>
    <dc:date>2014-03-13T16:20:34Z</dc:date>
    <item>
      <title>Errors when comparing values due to formatting</title>
      <link>https://community.qlik.com/t5/QlikView/Errors-when-comparing-values-due-to-formatting/m-p/573085#M213480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having errors when comparing values. The comparison is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am actually calculating a KPI value and displaying it as an expression formatted as Number, 2 decimal places in a chart.&amp;nbsp; I also have a target KPI value to which I am comparing the calculated KPI value and displaying a smiley of color green, orange or red.&amp;nbsp; The target KPIs are loaded from a CSV file (values are to 2d.p with a "%" at the end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample:&lt;/P&gt;&lt;P&gt;KPI_name, Threshold_1, Threshold_2&lt;/P&gt;&lt;P&gt;KPI1, 0.49%,0.50%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This means that when KPI1 &amp;lt;=0.49%, smiley color = green&lt;/P&gt;&lt;P&gt; 0.49% &amp;lt; KPI1 &amp;lt;= 0.50%, smiley color = orange&lt;/P&gt;&lt;P&gt;KPI1 &amp;gt; 0.50% , smiley color = red&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The values calculated in the expression might be to several decimal places (e.g 0.5033565899).&amp;nbsp; When displaying it in the chart, I am showing it as a number to 2 d.p (formatting done on Numbers tab in chart wizard) "= 0.50%" .&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To display the smiley, I am using the following:&lt;/P&gt;&lt;P&gt;if ( KPI1&amp;lt;= Threshold_1, green_smiley,&lt;/P&gt;&lt;P&gt;if (KPI1&amp;lt;= Threshold_2, orange_smiley, red_smiley))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when evaluating this comparison, it is showing the red smiley instead of the orange one.&amp;nbsp; I think it is the formating.&amp;nbsp; I have tried to compare the values using something like round(KPI1,0.01) &amp;lt;= round(Threshold_1,0.01), it still doesnt work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when displaying the threshold value is a table box, the value displays as 0.005%.&amp;nbsp; But I guess this should not be the issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advise&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Hasnaa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 16:06:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Errors-when-comparing-values-due-to-formatting/m-p/573085#M213480</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-13T16:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Errors when comparing values due to formatting</title>
      <link>https://community.qlik.com/t5/QlikView/Errors-when-comparing-values-due-to-formatting/m-p/573086#M213481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is KPI1?&lt;/P&gt;&lt;P&gt;It is string or column that contain any value for comparison?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 16:20:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Errors-when-comparing-values-due-to-formatting/m-p/573086#M213481</guid>
      <dc:creator>PrashantSangle</dc:creator>
      <dc:date>2014-03-13T16:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: Errors when comparing values due to formatting</title>
      <link>https://community.qlik.com/t5/QlikView/Errors-when-comparing-values-due-to-formatting/m-p/573087#M213482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps you're loading the values incorrectly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you upload .50%, thats equal to .005... so if your expressions value is higher than .005 you'll get the red smiley.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you mean that .50% should be equal to .5 which then you need to review how are you loading or transforming that number so that it represents .5 = 50%, not .005 = .5%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 16:21:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Errors-when-comparing-values-due-to-formatting/m-p/573087#M213482</guid>
      <dc:creator>Carlos_Reyes</dc:creator>
      <dc:date>2014-03-13T16:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Errors when comparing values due to formatting</title>
      <link>https://community.qlik.com/t5/QlikView/Errors-when-comparing-values-due-to-formatting/m-p/573088#M213483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;KPI1 is a calculated value which is displayed as number to 2 dp. it is based on calculations from pre existing value loaded in the data model&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 16:49:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Errors-when-comparing-values-due-to-formatting/m-p/573088#M213483</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-13T16:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: Errors when comparing values due to formatting</title>
      <link>https://community.qlik.com/t5/QlikView/Errors-when-comparing-values-due-to-formatting/m-p/573089#M213484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;is there a way of formatting the values in the script during loading? in the chart, when calculating KPI1 and displayign it as % to 2 dp, it is already evaluating as &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt; 0.00503356589 I guess&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it ok to compare values like if (&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;round(KPI1,0.01) &amp;lt;= round(Threshold_1,0.01), ...) ? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;Whats is the difference between functions Num, Num#, and round(xxx,0.01)?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;Hasnaa&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 16:52:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Errors-when-comparing-values-due-to-formatting/m-p/573089#M213484</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-13T16:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Errors when comparing values due to formatting</title>
      <link>https://community.qlik.com/t5/QlikView/Errors-when-comparing-values-due-to-formatting/m-p/573090#M213485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Review the enclosed example. It may help you discover what could be wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 17:18:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Errors-when-comparing-values-due-to-formatting/m-p/573090#M213485</guid>
      <dc:creator>Carlos_Reyes</dc:creator>
      <dc:date>2014-03-13T17:18:47Z</dc:date>
    </item>
  </channel>
</rss>

