<?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 Wildcard mapping from rule set into fact table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Wildcard-mapping-from-rule-set-into-fact-table/m-p/310049#M114475</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that MapSubString() or even ApplyMap() should do what you are looking for. Where does that Lookup.ISCMask field come from? Can you use a mapping table so if your Fact.ISC field is in Lookup.ISCMask using MapSubString()?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume you have already tested passing the value of Lookup.ISCMask to a variable, then use this variable in the WildMatch. The expansion cannot be done in the script, it always returns "Internal Error" when it parses a "$(=" string withing a function or a variable value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The map option, if possible, will likely be faster than the WildMatch, but not knowing your data model I don't know how to go ahead with a specific solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; text-decoration: underline; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Jul 2011 11:09:59 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2011-07-27T11:09:59Z</dc:date>
    <item>
      <title>Wildcard mapping from rule set into fact table</title>
      <link>https://community.qlik.com/t5/QlikView/Wildcard-mapping-from-rule-set-into-fact-table/m-p/310048#M114474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am writing a script which applies a rule set (20k rows) to a fact table (200k rows). The rule set contains a mapping of some of the attributes in the fact table to line numbers and column numbers that will be used to build a regulatory report. The simple mappings are no problem - this can be done with a join (not with a mapping table because a fact table record may map to more than one line and or column). The output is a link table which will contain a fact table key, report line, report column and value field name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My questions concerns wild card mappings. The link table has about 3 million rows after the simple mappings but I need to eliminate rows which fail a wildcard match on one field. This field may contain blanks in the fact table. What I tried to do was this load statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;EM&gt;Lookup2:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;LOAD Fact.Key,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Report.Line,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Report.Column,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Fact.ISC,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Lookup.ISCMask,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(WildMatch(Fact.ISC, $(=Lookup.ISCMask)), 1, 0) AS Fact.Match&lt;/P&gt;&lt;P&gt;Resident Lookup1; &lt;/P&gt;&lt;P&gt;﻿﻿﻿&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The statement works fine, except for the last line. Lookup.ISCMask contains a comma separated list of quoted match terms (for example '2.*','7.1*') and I was expecting the expansion to perform the wild card matches. Then I could use Fact.Match to eliminate those that do not match.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it does not work - get an internal error for the expansion. It is possible to do a variable expansion here, and I have used this form of a field expansion in expressions before, but it appears not to work in script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This post covers this problem using a variables:&amp;nbsp; &lt;A _jive_internal="true" href="https://community.qlik.com/thread/32425?tstart=0"&gt;http://community.qlik.com/thread/32425?tstart=0&lt;/A&gt; But looping over the data set using variables for the match takes far too long (several hours), although it does work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would welcome suggestions as to how to do this more quickly...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2011 06:45:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wildcard-mapping-from-rule-set-into-fact-table/m-p/310048#M114474</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2011-07-27T06:45:37Z</dc:date>
    </item>
    <item>
      <title>Wildcard mapping from rule set into fact table</title>
      <link>https://community.qlik.com/t5/QlikView/Wildcard-mapping-from-rule-set-into-fact-table/m-p/310049#M114475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that MapSubString() or even ApplyMap() should do what you are looking for. Where does that Lookup.ISCMask field come from? Can you use a mapping table so if your Fact.ISC field is in Lookup.ISCMask using MapSubString()?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume you have already tested passing the value of Lookup.ISCMask to a variable, then use this variable in the WildMatch. The expansion cannot be done in the script, it always returns "Internal Error" when it parses a "$(=" string withing a function or a variable value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The map option, if possible, will likely be faster than the WildMatch, but not knowing your data model I don't know how to go ahead with a specific solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; text-decoration: underline; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2011 11:09:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wildcard-mapping-from-rule-set-into-fact-table/m-p/310049#M114475</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-07-27T11:09:59Z</dc:date>
    </item>
    <item>
      <title>Wildcard mapping from rule set into fact table</title>
      <link>https://community.qlik.com/t5/QlikView/Wildcard-mapping-from-rule-set-into-fact-table/m-p/310050#M114476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Miguel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks - I am having some problem with this workstation and I will give a detailed reply later from my laptop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2011 14:45:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wildcard-mapping-from-rule-set-into-fact-table/m-p/310050#M114476</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2011-07-27T14:45:31Z</dc:date>
    </item>
    <item>
      <title>Wildcard mapping from rule set into fact table</title>
      <link>https://community.qlik.com/t5/QlikView/Wildcard-mapping-from-rule-set-into-fact-table/m-p/310051#M114477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #333333; font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Miguel&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #333333; font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Thanks for looking at this -MapSubString is a possibility.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #333333; font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Table Lookup1 is a join of the Facttable (Fact.Key and Fact.ISC) and the Rules table (Report.Line, Report.Column,Lookup.ISCMask) so there are different match strings in Lookup.ISCMask for eachcombination of Report.Line and Report.Column). That was why I was hoping to usea field expansion, but it seems that this is not possible. I may have to buildsome sort of composite value, map that and then break it into its componentsagain.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #333333; font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;I did try with variables, but itrequired looping over a 3 million rows building a result table of matches rowby row, which took several hours, so it tested the concept but cannot be usedon a production model.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #333333; font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #333333; font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Jonathan&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2011 19:53:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wildcard-mapping-from-rule-set-into-fact-table/m-p/310051#M114477</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2011-07-27T19:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Wildcard mapping from rule set into fact table</title>
      <link>https://community.qlik.com/t5/QlikView/Wildcard-mapping-from-rule-set-into-fact-table/m-p/310052#M114478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One approach would be to create a module function that did the test. So you could have something like&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;TestMask(Fact.ISC, Lookup.ISCMask) AS Fact.Match&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and in your module create the TestMask function and return the correct result. It would be really nice if you could do&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;TestMask = ActiveDocument.Evaluate("Wildmatch(" &amp;amp; str &amp;amp; "," &amp;amp; mask &amp;amp; ")")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but that doesn't work because ActiveDocument.Evaluate is not available until after load completes.But you could do something with VBA functions, either regular expressions or the like operator. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2011 00:31:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wildcard-mapping-from-rule-set-into-fact-table/m-p/310052#M114478</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2011-07-28T00:31:05Z</dc:date>
    </item>
    <item>
      <title>Wildcard mapping from rule set into fact table</title>
      <link>https://community.qlik.com/t5/QlikView/Wildcard-mapping-from-rule-set-into-fact-table/m-p/310053#M114479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks - I hadn't thought of doing it in VBA. Will give that a shot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2011 10:02:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wildcard-mapping-from-rule-set-into-fact-table/m-p/310053#M114479</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2011-07-28T10:02:16Z</dc:date>
    </item>
  </channel>
</rss>

