<?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 Create mapping table based upon defined frequency repartition in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-mapping-table-based-upon-defined-frequency-repartition/m-p/791283#M660497</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've been poundering of this, and I don't get an answer to my questions... So I'd like to have some more people to have a look at it in order to find a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a file containing OD's (%origin-%destination) between all stations, together with the following key variables : &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;/P&gt;&lt;P&gt;[%Line ID],&lt;BR /&gt;Date, &lt;BR /&gt;[%Key to Trains], &lt;BR /&gt;Class, &lt;BR /&gt;%TempProdKey, &lt;BR /&gt;[%Sales Channel], &lt;BR /&gt;Hour, &lt;BR /&gt;[# Revenue], &lt;BR /&gt;[# Travel],&lt;BR /&gt;[%Destination Station], &lt;BR /&gt;[%Origin Station]&lt;/P&gt;&lt;P&gt;Some of these O &amp;amp; D belong to a certain zone. Due to an incorrect registration, I need to take together all station codes from each zone, and the zone code itself. Then, I need to replace/re-distribute the individual station codes within each zone according to a pre-defined distribution. (this way, also removing the zone-code)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g. Zone L&amp;nbsp; (code 3100) contains station L (code 3001) &amp;amp; Station H (code 3126). I isolate all records that contain these 3 codes in their O(rigine). Then I defined that station L should get 85% of travels and station H 15%.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the re-distribution on row-level (working fine), but I would need it to be based on number of travellers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if I now get 750.000 lines with one of the 3 given codes, I can redistribute to 112.500 lines Station H and 637.500 lines Station L.&lt;/P&gt;&lt;P&gt;I would need however maybe 60.000 lines Station H, as these correspond to 15% of travellers within the total of the 750.000 lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea would be either to create a mapping table (as done now for the re-distribution on row-level), or to amend the table right away (probably per zone - 21 in total).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestion on how to approach this would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An aside, linked to this is that my tables are ordered by product code. Thus, assigning the first x lines to 1 single station risks to assign a too big proportion of a certain product to that particular station. Is there a way to either 'shuffle' the table, or select at random lines out of the table and assign them untill they've all been given a new station code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Mar 2015 13:31:55 GMT</pubDate>
    <dc:creator>puttemans</dc:creator>
    <dc:date>2015-03-25T13:31:55Z</dc:date>
    <item>
      <title>Create mapping table based upon defined frequency repartition</title>
      <link>https://community.qlik.com/t5/QlikView/Create-mapping-table-based-upon-defined-frequency-repartition/m-p/791283#M660497</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've been poundering of this, and I don't get an answer to my questions... So I'd like to have some more people to have a look at it in order to find a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a file containing OD's (%origin-%destination) between all stations, together with the following key variables : &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;/P&gt;&lt;P&gt;[%Line ID],&lt;BR /&gt;Date, &lt;BR /&gt;[%Key to Trains], &lt;BR /&gt;Class, &lt;BR /&gt;%TempProdKey, &lt;BR /&gt;[%Sales Channel], &lt;BR /&gt;Hour, &lt;BR /&gt;[# Revenue], &lt;BR /&gt;[# Travel],&lt;BR /&gt;[%Destination Station], &lt;BR /&gt;[%Origin Station]&lt;/P&gt;&lt;P&gt;Some of these O &amp;amp; D belong to a certain zone. Due to an incorrect registration, I need to take together all station codes from each zone, and the zone code itself. Then, I need to replace/re-distribute the individual station codes within each zone according to a pre-defined distribution. (this way, also removing the zone-code)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g. Zone L&amp;nbsp; (code 3100) contains station L (code 3001) &amp;amp; Station H (code 3126). I isolate all records that contain these 3 codes in their O(rigine). Then I defined that station L should get 85% of travels and station H 15%.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the re-distribution on row-level (working fine), but I would need it to be based on number of travellers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if I now get 750.000 lines with one of the 3 given codes, I can redistribute to 112.500 lines Station H and 637.500 lines Station L.&lt;/P&gt;&lt;P&gt;I would need however maybe 60.000 lines Station H, as these correspond to 15% of travellers within the total of the 750.000 lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea would be either to create a mapping table (as done now for the re-distribution on row-level), or to amend the table right away (probably per zone - 21 in total).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestion on how to approach this would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An aside, linked to this is that my tables are ordered by product code. Thus, assigning the first x lines to 1 single station risks to assign a too big proportion of a certain product to that particular station. Is there a way to either 'shuffle' the table, or select at random lines out of the table and assign them untill they've all been given a new station code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 13:31:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-mapping-table-based-upon-defined-frequency-repartition/m-p/791283#M660497</guid>
      <dc:creator>puttemans</dc:creator>
      <dc:date>2015-03-25T13:31:55Z</dc:date>
    </item>
  </channel>
</rss>

