<?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: Replacing Data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Replacing-Data/m-p/1521556#M437574</link>
    <description>&lt;P&gt;Dear Colin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As i wrote i already successes to "generate/duplicate&amp;nbsp;Data" based on our forecast parameters(i generated fictive products base on growth coefficient per category, and "duplicated" random lines for each category per day based on their&amp;nbsp;&lt;SPAN&gt;growth coefficients)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;the only problem is that i would like to replace the "Original ProductID" with random "&lt;SPAN&gt;ProductID"(from list)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;From my understand i should write a loop that will use pick+random function on the products tables (ProductID field)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;with "where Category=X" condition&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(X= will be change based on the "Original ProductID" in the line for each run)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But for some reason i did not success to pick random&amp;nbsp;ProductID with the same&amp;nbsp;Category as the original&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Dec 2018 12:31:13 GMT</pubDate>
    <dc:creator>shahafei2</dc:creator>
    <dc:date>2018-12-17T12:31:13Z</dc:date>
    <item>
      <title>Replacing Data</title>
      <link>https://community.qlik.com/t5/QlikView/Replacing-Data/m-p/1521427#M437561</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help me to find how to replace data&lt;/P&gt;&lt;P&gt;based on random data from other table in order to try to understand the impact of the forecast?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I succeeded to generate Orders and order lines based on our forecast, and to&amp;nbsp;&lt;SPAN&gt;generate fictive&amp;nbsp;&amp;nbsp;Products based on our category growth&amp;nbsp;&amp;nbsp;forecast&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The next step is to replace the&amp;nbsp;ProductID (Real) with random&amp;nbsp;ProductID (Real and&amp;nbsp;fictive)&amp;nbsp; from the same&amp;nbsp;Category&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two tables:&lt;/P&gt;&lt;P&gt;Orders:&lt;/P&gt;&lt;P&gt;OrderID&lt;/P&gt;&lt;P&gt;Date&lt;/P&gt;&lt;P&gt;ProductID&lt;/P&gt;&lt;P&gt;Qty&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Products:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ProductID&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ProductDesc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Category&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Price&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2018 07:37:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replacing-Data/m-p/1521427#M437561</guid>
      <dc:creator>shahafei2</dc:creator>
      <dc:date>2018-12-17T07:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing Data</title>
      <link>https://community.qlik.com/t5/QlikView/Replacing-Data/m-p/1521539#M437572</link>
      <description>&lt;P&gt;In the script editor there is an option on the Insert menu - "Test script" - this adds a script that generates 1000 rows of random data.&lt;BR /&gt;You can change the "&lt;STRONG&gt;autogenerate 1000&lt;/STRONG&gt;" row to set how many rows are created, and the "&lt;STRONG&gt;pick(ceil(N*rand1)...&lt;/STRONG&gt;" rows select 1 of N values of test data for each row.&lt;BR /&gt;You can modify these functions to create random data that is relevant to you.&lt;/P&gt;&lt;P&gt;// Test Script&lt;BR /&gt;Characters:&lt;BR /&gt;Load Chr(RecNo()+Ord('A')-1) as Alpha, RecNo() as Num autogenerate 26;&lt;BR /&gt;&lt;BR /&gt;ASCII:&lt;BR /&gt;Load&lt;BR /&gt;if(RecNo()&amp;gt;=65 and RecNo()&amp;lt;=90,RecNo()-64) as Num,&lt;BR /&gt;Chr(RecNo()) as AsciiAlpha,&lt;BR /&gt;RecNo() as AsciiNum&lt;BR /&gt;autogenerate 255&lt;BR /&gt;Where (RecNo()&amp;gt;=32 and RecNo()&amp;lt;=126) or RecNo()&amp;gt;=160 ;&lt;BR /&gt;&lt;BR /&gt;Transactions:&lt;BR /&gt;Load&lt;BR /&gt;TransLineID,&lt;BR /&gt;TransID,&lt;BR /&gt;mod(TransID,26)+1 as Num,&lt;BR /&gt;Pick(Ceil(3*Rand1),'A','B','C') as Dim1,&lt;BR /&gt;Pick(Ceil(6*Rand1),'a','b','c','d','e','f') as Dim2,&lt;BR /&gt;Pick(Ceil(3*Rand()),'X','Y','Z') as Dim3,&lt;BR /&gt;Round(1000*Rand()*Rand()*Rand1) as Expression1,&lt;BR /&gt;Round( 10*Rand()*Rand()*Rand1) as Expression2,&lt;BR /&gt;Round(Rand()*Rand1,0.00001) as Expression3;&lt;BR /&gt;Load&lt;BR /&gt;Rand() as Rand1,&lt;BR /&gt;IterNo() as TransLineID,&lt;BR /&gt;RecNo() as TransID&lt;BR /&gt;Autogenerate 1000&lt;BR /&gt;While Rand()&amp;lt;=0.5 or IterNo()=1;&lt;/P&gt;&lt;P&gt;Comment Field Dim1 With "This is a field comment";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2018 12:12:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replacing-Data/m-p/1521539#M437572</guid>
      <dc:creator>Colin-Albert</dc:creator>
      <dc:date>2018-12-17T12:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing Data</title>
      <link>https://community.qlik.com/t5/QlikView/Replacing-Data/m-p/1521556#M437574</link>
      <description>&lt;P&gt;Dear Colin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As i wrote i already successes to "generate/duplicate&amp;nbsp;Data" based on our forecast parameters(i generated fictive products base on growth coefficient per category, and "duplicated" random lines for each category per day based on their&amp;nbsp;&lt;SPAN&gt;growth coefficients)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;the only problem is that i would like to replace the "Original ProductID" with random "&lt;SPAN&gt;ProductID"(from list)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;From my understand i should write a loop that will use pick+random function on the products tables (ProductID field)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;with "where Category=X" condition&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(X= will be change based on the "Original ProductID" in the line for each run)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But for some reason i did not success to pick random&amp;nbsp;ProductID with the same&amp;nbsp;Category as the original&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2018 12:31:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replacing-Data/m-p/1521556#M437574</guid>
      <dc:creator>shahafei2</dc:creator>
      <dc:date>2018-12-17T12:31:13Z</dc:date>
    </item>
  </channel>
</rss>

