<?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: Inconsistent value format in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Inconsistent-value-format/m-p/412841#M484048</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your 0% mask in excel is just a zero with formatting. When loading the data from excel it only loads a 0. Formatting is not loaded. If you change the value in excel to a string then it will load as a string and can be used in the num and num# functions as a format string.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 May 2013 07:54:30 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2013-05-28T07:54:30Z</dc:date>
    <item>
      <title>Inconsistent value format</title>
      <link>https://community.qlik.com/t5/QlikView/Inconsistent-value-format/m-p/412840#M484047</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'm getting inconsistent result when I use Qlikview formatting in an IF condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached the qvw and the excel file that I used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following columns in the attached excel file:&lt;/P&gt;&lt;P&gt;DESC --&amp;gt; just the field description&lt;/P&gt;&lt;P&gt;VALUE --&amp;gt; the value to be formatted&lt;/P&gt;&lt;P&gt;FORMAT --&amp;gt; the format type (e.g. DOUBLE, INT, PCT (percentage), STRING)&lt;/P&gt;&lt;P&gt;MASK --&amp;gt; the format to be used (e.g. '#,##0.00', '0.00%', etc...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I loaded the VALUE field as text, because I need it to load exactly as in my source DB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is with the PCT (percent) format.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This expression will work:&lt;/STRONG&gt; &lt;SPAN style="font-family: 'courier new', courier;"&gt;If(Upper(Trim(FORMAT))='PCT', Num(Num#(VALUE, '0.00%'),'0.00%'),VALUE) as PCT_FORMAT_ONLY&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;But this will not:&lt;/STRONG&gt; &lt;SPAN style="font-family: 'courier new', courier;"&gt;If(Upper(Trim(FORMAT))='PCT', Num(Num#(VALUE, MASK),MASK),VALUE) as PCT_FORMAT_ONLY2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And if I added an IF condition for other format types, then the PCT format will work on some rows, but not on other rows.&lt;/P&gt;&lt;P&gt;If I use this expression:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;If(Upper(Trim(FORMAT))='PCT', Num(Num#(VALUE, '0.00%'),'0.00%'),&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;If(Upper(Trim(FORMAT))='DOUBLE',Num(Num#(VALUE, MASK), MASK),VALUE)) as VALUE_FORMAT2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some rows will correctly be formatted to percentage, but on some rows the formatting won't be apply.&lt;/P&gt;&lt;P&gt;I noticed, the format will not be apply if the value is 1.0000 or 0.&lt;/P&gt;&lt;P&gt;Please see the VALUE_FORMAT2 column in the attached qvw file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate all your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 04:23:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inconsistent-value-format/m-p/412840#M484047</guid>
      <dc:creator />
      <dc:date>2013-05-28T04:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent value format</title>
      <link>https://community.qlik.com/t5/QlikView/Inconsistent-value-format/m-p/412841#M484048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your 0% mask in excel is just a zero with formatting. When loading the data from excel it only loads a 0. Formatting is not loaded. If you change the value in excel to a string then it will load as a string and can be used in the num and num# functions as a format string.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 07:54:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inconsistent-value-format/m-p/412841#M484048</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-05-28T07:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent value format</title>
      <link>https://community.qlik.com/t5/QlikView/Inconsistent-value-format/m-p/412842#M484049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gysbert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even if I don't use the mask, and explicitly put in the percentage format, its still doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the expression in my script that doesn't work:&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;If(Upper(Trim(FORMAT))='PCT', Num(Num#(VALUE, '0.00%'),'0.00%'),&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Upper(Trim(FORMAT))='DOUBLE',Num(Num#(VALUE, MASK), MASK),VALUE)) as VALUE_FORMAT2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't use the 0% mask that was loaded from excel. I put in the actual percentage format, but it doesn't work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 10:45:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inconsistent-value-format/m-p/412842#M484049</guid>
      <dc:creator />
      <dc:date>2013-05-28T10:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent value format</title>
      <link>https://community.qlik.com/t5/QlikView/Inconsistent-value-format/m-p/412843#M484050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh, that. Yeah, that's a bit weird. You might call it a bug. Try adding a small fraction the VALUE for the PCT values:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Upper(Trim(FORMAT))='PCT', Num(0.00000000001+Num#(VALUE, MASK), MASK),If(Upper(Trim(FORMAT='DOUBLE')),Num(Num#(VALUE, MASK), MASK), VALUE)) as VALUE_FORMAT3,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 11:09:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inconsistent-value-format/m-p/412843#M484050</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-05-28T11:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent value format</title>
      <link>https://community.qlik.com/t5/QlikView/Inconsistent-value-format/m-p/412844#M484051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you. that trick works! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 07:39:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inconsistent-value-format/m-p/412844#M484051</guid>
      <dc:creator />
      <dc:date>2013-05-29T07:39:48Z</dc:date>
    </item>
  </channel>
</rss>

