<?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 Replacing data during load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Replacing-data-during-load/m-p/292514#M581693</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That worked flawlessly, and now I get how it works! Thank you. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Dec 2011 17:32:39 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-12-12T17:32:39Z</dc:date>
    <item>
      <title>Replacing data during load</title>
      <link>https://community.qlik.com/t5/QlikView/Replacing-data-during-load/m-p/292510#M581689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm loading data from a database where the information stored within is stored and called using perl scripts, so it contains code such as __b for a space, __P for (, __p for ), etc. So when I LOAD ASSIGNEES, I get data like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Support__bTeam__b1&lt;/P&gt;&lt;P&gt;Support__bTeam__b2&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not a SQL master, I only know the basics and can normally find answers online but this has me at a loss. I was thinking of incorporating a REPLACE statement, but I don't know how to write it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, some data is loaded that I really don't need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For instance, using the same example of Teams, I sometimes get a team name and a person's name:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Support__bTeam__b1 Technician__bJohn&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Support__bTeam__b1 Support__bTeam__b2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Support__bTeam__b1 Techniciain__bJohn Support__bTeam__b2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to drop all of the technicians completely and I want to be able to call the records by team.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in my graph, I want to see:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Support Team 1 = 10 records&lt;/P&gt;&lt;P&gt;Support Team 2 = 12 records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where some of the records counted could actually have one of the teams, or both. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does this make any sense?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my load statement:&lt;/P&gt;&lt;P&gt;&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;/P&gt;&lt;P&gt;ServiceDeskAssignees:&lt;/P&gt;&lt;P&gt;LOAD mrID AS TicketNumber,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mrASSIGNEES As Assignees;&lt;/P&gt;&lt;P&gt;SQL &lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;FROM Footprints.dbo.MASTER1&lt;/P&gt;&lt;P&gt;WHERE mrSTATUS!='_DELETED_' &lt;/P&gt;&lt;P&gt;AND ((mrREF_TO_MR IS NULL) or ((mrREF_TO_MR NOT LIKE '%R%') and (mrREF_TO_MR NOT LIKE '%Q%'))) &lt;/P&gt;&lt;P&gt;AND (mrSTATUS IN ('Open', 'Assigned__bto__bTeam', 'Assigned__bto__bAgent', 'Pending', 'Pending__bCustomer', 'For__bFollow__bUP', 'Customer__bResponse', 'Closed'));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Dec 2011 21:08:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replacing-data-during-load/m-p/292510#M581689</guid>
      <dc:creator />
      <dc:date>2011-12-10T21:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing data during load</title>
      <link>https://community.qlik.com/t5/QlikView/Replacing-data-during-load/m-p/292511#M581690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of REPLACE, I would suggest to use mapsubstring function with a mapping table, which also takes care to replace all appropriate placeholders.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To remove the technicians, you could add an appropriate where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All in all, maybe something along these lines:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mapTable:&lt;/P&gt;&lt;P&gt;mapping load * INLINE [&lt;/P&gt;&lt;P&gt;perl, replace&lt;/P&gt;&lt;P&gt;__b , " "&lt;/P&gt;&lt;P&gt;__P , "("&lt;/P&gt;&lt;P&gt;__p , ")"&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INPUT:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;input&lt;/P&gt;&lt;P&gt;Support__bTeam__b1 Technician__bJohn&lt;/P&gt;&lt;P&gt;Support__bTeam__b1 Support__bTeam__b2&lt;/P&gt;&lt;P&gt;Support__bTeam__b1 Techniciain__bJohn Support__bTeam__b2&lt;/P&gt;&lt;P&gt;Support__bTeam__b1 __PTechnician__bJohn__p&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RESULT:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;mapsubstring('mapTable', input) as Result&lt;/P&gt;&lt;P&gt;resident INPUT&lt;/P&gt;&lt;P&gt;// where not wildmatch(input,'*Technician*')&lt;/P&gt;&lt;P&gt; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I first define a mapping table (just add any other placeholders and the strings to replace). Then I loaded some data (like your table load), and then I did a resident load with where clause to only load the data of interest (to actually see only the limited data, comment the where clause in). One Techniciain is left, because of the typo, but you could adapt the wildmatch to maybe take care of that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Dec 2011 21:59:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replacing-data-during-load/m-p/292511#M581690</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-12-10T21:59:10Z</dc:date>
    </item>
    <item>
      <title>Replacing data during load</title>
      <link>https://community.qlik.com/t5/QlikView/Replacing-data-during-load/m-p/292512#M581691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This didn't work for me, I'm not able to insert the SQL query into the LOAD * INLINE [&amp;nbsp; ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm getting is the results showing my SQL query line items. I've never done a mapping table before, so I don't even know why it's failing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I don't know how I'm going to load another variable outside of the mapping table in order to create a relational link to this new data. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Dec 2011 16:02:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replacing-data-during-load/m-p/292512#M581691</guid>
      <dc:creator />
      <dc:date>2011-12-12T16:02:54Z</dc:date>
    </item>
    <item>
      <title>Replacing data during load</title>
      <link>https://community.qlik.com/t5/QlikView/Replacing-data-during-load/m-p/292513#M581692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, you don't use an INLINE load for your data, that was just for demonstration. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mapTable:&lt;/P&gt;&lt;P&gt;mapping load * INLINE [&lt;/P&gt;&lt;P&gt;perl, replace&lt;/P&gt;&lt;P&gt;__b , " "&lt;/P&gt;&lt;P&gt;__P , "("&lt;/P&gt;&lt;P&gt;__p , ")"&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;ServiceDeskAssignees:&lt;BR /&gt;LOAD mrID AS TicketNumber,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;mapsubstring('mapTable', mrASSIGNEES) as &lt;CODE class="jive-code"&gt;Assignees;&lt;BR /&gt;SQL &lt;BR /&gt;SELECT *&lt;BR /&gt;FROM Footprints.dbo.MASTER1&lt;BR /&gt;WHERE mrSTATUS!='_DELETED_' &lt;BR /&gt;AND ((mrREF_TO_MR IS NULL) or ((mrREF_TO_MR NOT LIKE '%R%') and (mrREF_TO_MR NOT LIKE '%Q%'))) &lt;BR /&gt;AND (mrSTATUS IN ('Open', 'Assigned__bto__bTeam', 'Assigned__bto__bAgent', 'Pending', 'Pending__bCustomer', 'For__bFollow__bUP', 'Customer__bResponse', 'Closed'));&lt;BR /&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Dec 2011 16:08:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replacing-data-during-load/m-p/292513#M581692</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-12-12T16:08:46Z</dc:date>
    </item>
    <item>
      <title>Replacing data during load</title>
      <link>https://community.qlik.com/t5/QlikView/Replacing-data-during-load/m-p/292514#M581693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That worked flawlessly, and now I get how it works! Thank you. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Dec 2011 17:32:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replacing-data-during-load/m-p/292514#M581693</guid>
      <dc:creator />
      <dc:date>2011-12-12T17:32:39Z</dc:date>
    </item>
  </channel>
</rss>

