<?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: Validate data with different allowed formats in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Validate-data-with-different-allowed-formats/m-p/946544#M648238</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, not to disclose data .....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Oct 2015 16:34:52 GMT</pubDate>
    <dc:creator>Michiel_QV_Fan</dc:creator>
    <dc:date>2015-10-22T16:34:52Z</dc:date>
    <item>
      <title>Validate data with different allowed formats</title>
      <link>https://community.qlik.com/t5/QlikView/Validate-data-with-different-allowed-formats/m-p/946538#M648232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;I have a column accountID which contains valid values in different formats and invalid values in (for now 1 format). I want to validate based on rules.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Valid accountID represenations are:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; 020&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (a 0 is added with the num function to create 0020)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt; 1050&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt; 8010&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;12350&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;07830&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;80150&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;etc.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Invalid accountID representation is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;01050, 08010 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;(this is the same value as the Valid accountID representation but with a preceding 0.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;I do not know in which data file (*) (multiple) accountID is formatted as valid of invalid. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;The accountID will be linked to second table, related to each individual data file (*). This table has the correct value for accountID, for instance 01050 has (the valid) value 1050 in the second table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;I tested the pick and wildmatch function from &lt;A href="https://community.qlik.com/qlik-users/2286"&gt;rwunderlich&lt;/A&gt;‌ and that works for the invalid accountID where I added a ? to the other table but this cannot be used not when the 5 characters accountID is loaded......&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;How could I validate the format in this case?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2015 13:22:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Validate-data-with-different-allowed-formats/m-p/946538#M648232</guid>
      <dc:creator>Michiel_QV_Fan</dc:creator>
      <dc:date>2015-10-22T13:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Validate data with different allowed formats</title>
      <link>https://community.qlik.com/t5/QlikView/Validate-data-with-different-allowed-formats/m-p/946539#M648233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this can help you : &lt;A href="http://www.qlikfix.com/2010/10/18/regular-expressions-in-the-load-script/"&gt;http://www.qlikfix.com/2010/10/18/regular-expressions-in-the-load-script/&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2015 13:33:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Validate-data-with-different-allowed-formats/m-p/946539#M648233</guid>
      <dc:creator>gardenierbi</dc:creator>
      <dc:date>2015-10-22T13:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: Validate data with different allowed formats</title>
      <link>https://community.qlik.com/t5/QlikView/Validate-data-with-different-allowed-formats/m-p/946540#M648234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried using text() around everything? Then you could test with exists:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD text(accountid) as ValidAccount from ...'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD accountid, exists(ValidAccount, text(accountId)) as IsValidAccount from transactiions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2015 13:39:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Validate-data-with-different-allowed-formats/m-p/946540#M648234</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-10-22T13:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Validate data with different allowed formats</title>
      <link>https://community.qlik.com/t5/QlikView/Validate-data-with-different-allowed-formats/m-p/946541#M648235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sander, usefull function but my accountID only contains numbers. 3, 4 or 5 digits are all ok. But 5 digits can be valid as well as invalid, depending on the content of the second table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2015 13:57:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Validate-data-with-different-allowed-formats/m-p/946541#M648235</guid>
      <dc:creator>Michiel_QV_Fan</dc:creator>
      <dc:date>2015-10-22T13:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Validate data with different allowed formats</title>
      <link>https://community.qlik.com/t5/QlikView/Validate-data-with-different-allowed-formats/m-p/946542#M648236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rob,&lt;/P&gt;&lt;P&gt;Thanks for the suggestion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To elaborate more on the question;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the table with the valid accountID format I have for instance:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1050&lt;/P&gt;&lt;P&gt;8011&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And in the table with invalid data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;01050&lt;/P&gt;&lt;P&gt;08011&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to match 01050 with 1050. That's why I used the $(vMapExpr(accountID)) from your cookbook. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the next load I have valid: 80150 with match 80150.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I load all these tables in 1 load statement with a loop to process all tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can imagine it's not posible to solve this because I'm only working with numbers. In that case I have to figure out a work around.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2015 14:05:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Validate-data-with-different-allowed-formats/m-p/946542#M648236</guid>
      <dc:creator>Michiel_QV_Fan</dc:creator>
      <dc:date>2015-10-22T14:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Validate data with different allowed formats</title>
      <link>https://community.qlik.com/t5/QlikView/Validate-data-with-different-allowed-formats/m-p/946543#M648237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you upload a sample file?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2015 14:23:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Validate-data-with-different-allowed-formats/m-p/946543#M648237</guid>
      <dc:creator>gardenierbi</dc:creator>
      <dc:date>2015-10-22T14:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Validate data with different allowed formats</title>
      <link>https://community.qlik.com/t5/QlikView/Validate-data-with-different-allowed-formats/m-p/946544#M648238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, not to disclose data .....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2015 16:34:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Validate-data-with-different-allowed-formats/m-p/946544#M648238</guid>
      <dc:creator>Michiel_QV_Fan</dc:creator>
      <dc:date>2015-10-22T16:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: Validate data with different allowed formats</title>
      <link>https://community.qlik.com/t5/QlikView/Validate-data-with-different-allowed-formats/m-p/946545#M648239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solution found.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sander, Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a solution. Easier than I first thoughed but this works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My solution:&lt;/P&gt;&lt;P&gt;First I load the table that has the Valid values. &lt;/P&gt;&lt;P&gt;I calculate the max length of that string and store that in variable &lt;EM&gt;length&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AccountID_length:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; max(len(accountID)) as accountID_length&lt;/P&gt;&lt;P&gt;Resident [my table];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let length = peek('&lt;SPAN style="font-size: 13.3333px;"&gt;accountID_length&lt;/SPAN&gt;', 0, '&lt;SPAN style="font-size: 13.3333px;"&gt;AccountID_length&lt;/SPAN&gt;');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next I load the transaction with the Valid and/or Invalid values but I add &lt;/P&gt;&lt;P&gt;right(accountID, &lt;EM&gt;$(length)&lt;/EM&gt;) &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;as accountID &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;to that load. Preceding Invalid characters (numbers) are eliminated this way.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/alert.png" /&gt; The downside of this is that as long as the Invalid values don't have a suffix added in the transaction this will work. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Oct 2015 08:12:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Validate-data-with-different-allowed-formats/m-p/946545#M648239</guid>
      <dc:creator>Michiel_QV_Fan</dc:creator>
      <dc:date>2015-10-23T08:12:27Z</dc:date>
    </item>
  </channel>
</rss>

