<?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 How can I convert a text into a number? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-can-I-convert-a-text-into-a-number/m-p/370266#M137683</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No worked TEXT(MATNR), neither NUM#(MATNR)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 May 2012 17:53:53 GMT</pubDate>
    <dc:creator>rcandeo</dc:creator>
    <dc:date>2012-05-25T17:53:53Z</dc:date>
    <item>
      <title>How can I convert a text into a number?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-convert-a-text-into-a-number/m-p/370263#M137680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We use SAP and the material number (MATNR) is a field with lenght 18 and char.&lt;/P&gt;&lt;P&gt;We only use numbers but when I bring to qlik view I receive the information like this:&lt;/P&gt;&lt;P&gt;000000000000123456&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even if I use in the script Num(MATNR) or NUM(MATNR, '0'), I still get the result like 000000000000123456&lt;/P&gt;&lt;P&gt;I tried to change in the properties of the document in the NUMBER tag that the MATNR is a number but with no sucess.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I make this transformation to have only 123456?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 17:29:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-convert-a-text-into-a-number/m-p/370263#M137680</guid>
      <dc:creator>rcandeo</dc:creator>
      <dc:date>2012-05-25T17:29:04Z</dc:date>
    </item>
    <item>
      <title>How can I convert a text into a number?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-convert-a-text-into-a-number/m-p/370264#M137681</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;try to use : text(MATNR) . I hope this can help you.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Heri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 17:35:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-convert-a-text-into-a-number/m-p/370264#M137681</guid>
      <dc:creator />
      <dc:date>2012-05-25T17:35:30Z</dc:date>
    </item>
    <item>
      <title>How can I convert a text into a number?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-convert-a-text-into-a-number/m-p/370265#M137682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried using Num#(MANTR)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 17:35:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-convert-a-text-into-a-number/m-p/370265#M137682</guid>
      <dc:creator>Jason_Michaelides</dc:creator>
      <dc:date>2012-05-25T17:35:30Z</dc:date>
    </item>
    <item>
      <title>How can I convert a text into a number?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-convert-a-text-into-a-number/m-p/370266#M137683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No worked TEXT(MATNR), neither NUM#(MATNR)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 17:53:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-convert-a-text-into-a-number/m-p/370266#M137683</guid>
      <dc:creator>rcandeo</dc:creator>
      <dc:date>2012-05-25T17:53:53Z</dc:date>
    </item>
    <item>
      <title>How can I convert a text into a number?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-convert-a-text-into-a-number/m-p/370267#M137684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try some of the solutions here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://community.qlik.com/message/63300#63300"&gt;http://community.qlik.com/message/63300#63300&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 17:58:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-convert-a-text-into-a-number/m-p/370267#M137684</guid>
      <dc:creator>Jason_Michaelides</dc:creator>
      <dc:date>2012-05-25T17:58:38Z</dc:date>
    </item>
    <item>
      <title>How can I convert a text into a number?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-convert-a-text-into-a-number/m-p/370268#M137685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi rcandeo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a parameter variable in your script such as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// ------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;// Take off leading zeros and convert to number&lt;/P&gt;&lt;P&gt;// Usage: $(vCHAR2NUM(MATNR)) AS [Material_MATNR]&lt;/P&gt;&lt;P&gt;// ------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;SET vCHAR2NUM = REPLACE(LTRIM(REPLACE($1, '0', ' ')), ' ', 0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then In your Load&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tablename:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load&amp;nbsp; $(vCHAR2NUM(MATNR)) AS [Material_MATNR],&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and that will convert any 'NumChar' to a Number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dave.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 18:32:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-convert-a-text-into-a-number/m-p/370268#M137685</guid>
      <dc:creator />
      <dc:date>2012-05-25T18:32:09Z</dc:date>
    </item>
    <item>
      <title>How can I convert a text into a number?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-convert-a-text-into-a-number/m-p/370269#M137686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All answer you people are giving to me are very useful, but only work with the QVW that get the data directly on SAP. &lt;/P&gt;&lt;P&gt;After bringing the data from SAP and generating a QVD file, if I try to open this QVD file and aply any of these sugestions, they don´t work. Any idea why?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 19:14:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-convert-a-text-into-a-number/m-p/370269#M137686</guid>
      <dc:creator>rcandeo</dc:creator>
      <dc:date>2012-05-25T19:14:03Z</dc:date>
    </item>
    <item>
      <title>How can I convert a text into a number?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-convert-a-text-into-a-number/m-p/370270#M137687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, QV supports a maximum of 14 digits in your number. If it is longer than that,&amp;nbsp; it will be interpreted a a text.&lt;/P&gt;&lt;P&gt;Maybe when you load it and export it to QVD with the zeros on the left, QV will interpret it incorrectly again when the QVD is loaded. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, you can use evaluate() to convert your original text into a integer.Then, you can use NUM to format it appropriately &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the example below, the operation in EVLN2 is probaly the one that you need. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;VERY_LONG_NUMBER, &lt;/P&gt;&lt;P&gt;NUM(VERY_LONG_NUMBER) AS NUMVLN, &lt;/P&gt;&lt;P&gt;EVALUATE(VERY_LONG_NUMBER) AS EVLN ,&lt;/P&gt;&lt;P&gt;num( EVALUATE(VERY_LONG_NUMBER),'#0') AS EVLN2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; VERY_LONG_NUMBER&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0000000000000000132123&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 19:29:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-convert-a-text-into-a-number/m-p/370270#M137687</guid>
      <dc:creator>erichshiino</dc:creator>
      <dc:date>2012-05-25T19:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: How can I convert a text into a number?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-convert-a-text-into-a-number/m-p/370271#M137688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This worked perfectly in the initial extraction of data (using SAP Connector) from SAP for Material Number MATNR:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// VBAP (Sales Document:Item Data)&lt;/P&gt;&lt;P&gt;[VBAP]:&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; [VBELN] ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; [POSNR] ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; [MATNR] ,&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;&amp;nbsp;&amp;nbsp; NUM(EVALUATE([MATNR]),'#0') as 'MATNR_SHRT',&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; [PRODH] as [Product Hierarchy_PRODH.VBAP],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; [NETWR] as [Net Value_NETWR.VBAP],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; [WAERK] as [SD Document Currency_WAERK.VBAP],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; [KWMENG] as [Cumulative Order Qty_KWMENG.VBAP],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; [VRKME] as [Sales Unit_VRKME.VBAP],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; [BRGEW] as [Gross Weight_BRGEW.VBAP],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; [NTGEW] as [Net Weight Item_NTGEW.VBAP],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; [GEWEI] as [Weight Unit_GEWEI.VBAP],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; [WERKS] as [Plant_WERKS.VBAP],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; [VSTEL] as [Shipping Point/Receiving Pt_VSTEL.VBAP];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; SQL Select VBELN POSNR MATNR PRODH NETWR WAERK KWMENG VRKME BRGEW NTGEW GEWEI WERKS VSTEL from VBAP&lt;/P&gt;&lt;P&gt;where ERDAT&amp;gt;='20130101'&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;STORE VBAP into [lib://SalesExtract/VBAP.qvd] (qvd);&lt;/P&gt;&lt;P&gt;DROP TABLE [VBAP];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if you run the above NUM function against data already stored in the QVD, it will return empty (aka: not work)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Nov 2015 20:55:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-convert-a-text-into-a-number/m-p/370271#M137688</guid>
      <dc:creator />
      <dc:date>2015-11-04T20:55:51Z</dc:date>
    </item>
  </channel>
</rss>

