<?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: Two fields in one table using the same dimension in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Two-fields-in-one-table-using-the-same-dimension/m-p/1370347#M823201</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Hi Philip, I think the best option will be to have two dimensions.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;If for any case you want only location to filter any location (current or home) you can create a composed key with current and home. Then create a table with a row for each location and combination, in example:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;mLocations:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Mapping LOAD * INLINE [&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LocationCode, LocationName&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;FLO001, Florida Site A&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;COL001, Colorado Site A&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;TEX001, Texas Site A&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;];&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Data:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LOAD *, CurrentLocation &amp;amp;'#'&amp;amp; HomeLocation as keyLocation INLINE [&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PersonID, StartDate, EndDate, CurrentLocation, HomeLocation&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2332, 1/1/17, 5/1/17, TEX001, FLO001&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2332, 5/2/17, , FLO001, FLO001&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2442, 5/1/17, , FLO001, FLO001&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2342, 4/1/17, 8/1/17, COL001, TEX001&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2342, 8/2/17, , TEX001, TEX001&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;];&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Locations:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LOAD keyLocation,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;ApplyMap('mLocations', Location) as Location;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LOAD FieldValue('keyLocation', RecNo()) as keyLocation,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;SubField(FieldValue('keyLocation', RecNo()), '#') as Location&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;AutoGenerate FieldValueCount('keyLocation');&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Jul 2017 18:51:04 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2017-07-25T18:51:04Z</dc:date>
    <item>
      <title>Two fields in one table using the same dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Two-fields-in-one-table-using-the-same-dimension/m-p/1370345#M823199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have two fields in one of our employee tables that uses the same lookup dimension and I can't figure out how to make it work within QlikView.&amp;nbsp; We track a 'CurrentLocation' and 'HomeLocation' and each field stores a 'LocationCode'.&amp;nbsp; What is my best bet for being able to use the same dimension field for two fields when they're stored in the same table?&amp;nbsp; I thought about trying to load the 'employeelocation' table twice but this caused a loop due to the unique person identifier.&amp;nbsp; My next attempt was to try and load the Locations table twice using a different naming convention to avoid loops, but this forces me to have two dimension tables.&amp;nbsp; Most of our dashboards we are only loading one of the two, but we had a new request that requires both current and home locations to be accessible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps I'm making this more complicated than it needs to be, I just haven't figured out a way to make it work.&amp;nbsp; Here's a example of the data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EmployeeLocations:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;PersonID&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;StartDate&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;EndDate&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;CurrentLocation&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;HomeLocation&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2332&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1/1/17&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5/1/17&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;TEX001&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;FLO001&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD colspan="1"&gt;2332&lt;/TD&gt;&lt;TD colspan="1"&gt;5/2/17&lt;/TD&gt;&lt;TD colspan="1"&gt;&lt;/TD&gt;&lt;TD colspan="1"&gt;FLO001&lt;/TD&gt;&lt;TD colspan="1"&gt;FLO001&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2442&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5/1/17&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;FLO001&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;FLO001&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2342&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4/1/17&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;8/1/17&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;COL001&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;TEX001&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2342&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;8/2/17&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;TEX001&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;TEX001&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Locations:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;LocationCode&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;LocationName&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;FLO001&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Florida Site A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;COL001&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Colorado Site A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;TEX001&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Texas Site A&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-fields-in-one-table-using-the-same-dimension/m-p/1370345#M823199</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Two fields in one table using the same dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Two-fields-in-one-table-using-the-same-dimension/m-p/1370346#M823200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Phillip,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can use ApplyMap twice to get two new fields CurLocationName and HomeLocationName.&lt;/P&gt;&lt;P&gt;Why don't you use the below script in order to get your result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MapLocation:&lt;/P&gt;&lt;P&gt;Mapping&lt;/P&gt;&lt;P&gt;LOAD LocationCode, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LocationName&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;A class="jive-link-thread-small" data-containerid="2003" data-containertype="14" data-objectid="268929" data-objecttype="1" href="https://community.qlik.com/thread/268929"&gt;https://community.qlik.com/thread/268929&lt;/A&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(html, codepage is 1252, embedded labels, table is @2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EmployeeLocations:&lt;/P&gt;&lt;P&gt;LOAD PersonID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StartDate, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EndDate, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CurrentLocation, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HomeLocation,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ApplyMap('MapLocation', CurrentLocation, '-') as CurLocationName,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ApplyMap('MapLocation', HomeLocation, '-') as HomeLocationName&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;A class="jive-link-thread-small" data-containerid="2003" data-containertype="14" data-objectid="268929" data-objecttype="1" href="https://community.qlik.com/thread/268929"&gt;https://community.qlik.com/thread/268929&lt;/A&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(html, codepage is 1252, embedded labels, table is @1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Happy Qliking&lt;/P&gt;&lt;P&gt;Burkhard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jul 2017 18:29:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-fields-in-one-table-using-the-same-dimension/m-p/1370346#M823200</guid>
      <dc:creator>veidlburkhard</dc:creator>
      <dc:date>2017-07-25T18:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Two fields in one table using the same dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Two-fields-in-one-table-using-the-same-dimension/m-p/1370347#M823201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Hi Philip, I think the best option will be to have two dimensions.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;If for any case you want only location to filter any location (current or home) you can create a composed key with current and home. Then create a table with a row for each location and combination, in example:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;mLocations:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Mapping LOAD * INLINE [&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LocationCode, LocationName&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;FLO001, Florida Site A&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;COL001, Colorado Site A&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;TEX001, Texas Site A&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;];&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Data:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LOAD *, CurrentLocation &amp;amp;'#'&amp;amp; HomeLocation as keyLocation INLINE [&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PersonID, StartDate, EndDate, CurrentLocation, HomeLocation&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2332, 1/1/17, 5/1/17, TEX001, FLO001&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2332, 5/2/17, , FLO001, FLO001&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2442, 5/1/17, , FLO001, FLO001&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2342, 4/1/17, 8/1/17, COL001, TEX001&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2342, 8/2/17, , TEX001, TEX001&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;];&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Locations:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LOAD keyLocation,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;ApplyMap('mLocations', Location) as Location;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LOAD FieldValue('keyLocation', RecNo()) as keyLocation,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;SubField(FieldValue('keyLocation', RecNo()), '#') as Location&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;AutoGenerate FieldValueCount('keyLocation');&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jul 2017 18:51:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-fields-in-one-table-using-the-same-dimension/m-p/1370347#M823201</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2017-07-25T18:51:04Z</dc:date>
    </item>
  </channel>
</rss>

