<?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 Simple Conditional Load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Simple-Conditional-Load/m-p/177297#M44972</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;its not clear in which condition you would like to eliminate the Original sales and associated return. Might be, If it is having a return ( SalesCount= - 1)...then only you don't want to take that sale and return into count. Is it so? If so then you can go with.....&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;FROM yourtable WHERE SalesCount&amp;lt;&amp;gt; -1;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;tresesco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Nov 2010 05:58:18 GMT</pubDate>
    <dc:creator>tresB</dc:creator>
    <dc:date>2010-11-09T05:58:18Z</dc:date>
    <item>
      <title>Simple Conditional Load</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-Conditional-Load/m-p/177295#M44970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am new to QlikView but am loving it so far! I have a question about a datafile that I am loading - the file contains product sales data. What I discovered in the file is that it contains both sales and returns in the same file which is skewing my statistics.&lt;/P&gt;&lt;P&gt;The file has two fields I am interested in using for the conditional load - the first is TransactionID (unique for all purchases) and field called SalesCount (which has a value of 1 or -1 depending upon if the transaction was a sale (1) or a return (-1)).&lt;/P&gt;&lt;P&gt;I would like to eliminate the original sale (e.g., TransactionID=1234 and SalesCount=1) and the associated return (TransactionID=1234 and SalesCount=-1) of the items upon loading the data. Any ideas how I could do something like this?&lt;/P&gt;&lt;P&gt;Thank you in advance for any and all help!&lt;/P&gt;&lt;P&gt;Rick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 05:18:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-Conditional-Load/m-p/177295#M44970</guid>
      <dc:creator />
      <dc:date>2010-11-09T05:18:33Z</dc:date>
    </item>
    <item>
      <title>Simple Conditional Load</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-Conditional-Load/m-p/177296#M44971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;Load TransactionID,&lt;BR /&gt;SalesCount*(-1) asSalesCount&lt;BR /&gt;From yourtable;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 05:37:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-Conditional-Load/m-p/177296#M44971</guid>
      <dc:creator />
      <dc:date>2010-11-09T05:37:01Z</dc:date>
    </item>
    <item>
      <title>Simple Conditional Load</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-Conditional-Load/m-p/177297#M44972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;its not clear in which condition you would like to eliminate the Original sales and associated return. Might be, If it is having a return ( SalesCount= - 1)...then only you don't want to take that sale and return into count. Is it so? If so then you can go with.....&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;FROM yourtable WHERE SalesCount&amp;lt;&amp;gt; -1;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;tresesco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 05:58:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-Conditional-Load/m-p/177297#M44972</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2010-11-09T05:58:18Z</dc:date>
    </item>
    <item>
      <title>Simple Conditional Load</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-Conditional-Load/m-p/177298#M44973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure what your data source is but in SQL Server you can have this load script:&lt;/P&gt;&lt;P&gt;ODBC CONNECT TO &amp;lt;YOURDATASOURCE&amp;gt; (XUserId is &amp;lt;YOURUSERNAME&amp;gt;, XPassword is &amp;lt;YOURPASSWORD&amp;gt;);&lt;BR /&gt;SQL SELECT &amp;lt;Field1&amp;gt;,&lt;BR /&gt; &amp;lt;Field2&amp;gt;,&lt;BR /&gt; &amp;lt;Field3&amp;gt;,&lt;BR /&gt; &amp;lt;Field4&amp;gt;,&lt;BR /&gt; TransactionID,&lt;BR /&gt; SalesCount&lt;BR /&gt;FROM &amp;lt;Transaction Table&amp;gt; A where A.SalesCount = 1 and A.TransactionID not in (select B.obi_shipmentid from &amp;lt;Transaction Table&amp;gt; B where B.TransactionID = A.B.TransactionID and B.SalesCount = -1);&lt;/P&gt;&lt;P&gt;Though, depending your business rule this may or may not work. Rule such as&lt;/P&gt;&lt;P&gt;1. multiple returns tied to single transaction&lt;/P&gt;&lt;P&gt;2. Partial returns (meaning the value is not equal to the actual transaction)&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 06:44:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-Conditional-Load/m-p/177298#M44973</guid>
      <dc:creator />
      <dc:date>2010-11-09T06:44:11Z</dc:date>
    </item>
    <item>
      <title>Simple Conditional Load</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-Conditional-Load/m-p/177299#M44974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rick&lt;/P&gt;&lt;P&gt;If you want to eliminate the returns at source, then pinongs has the correct approach, but I think the FROM clause is not quite right. Suggested alternative:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;SQL SELECT&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;FROM &amp;lt;Transaction Table&amp;gt; A where A.SalesCount = 1 and A.TransactionID not in&lt;BR /&gt;(select B.TransactionID from &amp;lt;Transaction Table&amp;gt; B where B.SalesCount = -1);&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;But do you really want to eliminate them at source? You might want that info in your model (ie returns analysis).&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 06:52:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-Conditional-Load/m-p/177299#M44974</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2010-11-09T06:52:08Z</dc:date>
    </item>
    <item>
      <title>Simple Conditional Load</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-Conditional-Load/m-p/177300#M44975</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;Thank you for all of the suggestions. The data was provided to us in a CSV file which I am loading into the model. For this particular model I would like to eliminate all sales and all returns that have the same TransactionID. This would be in two different lines of the data. I would just like to analyze the actual sales that people have not returned.&lt;/P&gt;&lt;P&gt;Does this provide the information that you need?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 20:47:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-Conditional-Load/m-p/177300#M44975</guid>
      <dc:creator />
      <dc:date>2010-11-09T20:47:37Z</dc:date>
    </item>
    <item>
      <title>Simple Conditional Load</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-Conditional-Load/m-p/177301#M44976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rick,&lt;/P&gt;&lt;P&gt;Something like the following might work, although not likely the most beautiful way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;ReturnsMap:MAPPING LOAD TransactionID, SalesCountFROM File.csvWHERE SalesCount = -1; SalesNotReturned:LOAD TransactionID, SalesCountFROM File.csvWHERE SalesCount = 1 AND ApplyMap('ReturnsMap', TransactionID, '$') = '$';&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;It loads a mapping table in the first case only with those TransactionIDs that have Sales = -1. Then, this map is used to not to load those TransactionIDs that have SalesCount = 1 and are not in the mapping table (the '$' is the default value for those values for the field passed that are not in the mapping table, you can change that to any other symbol that's not present in yoru data).&lt;/P&gt;&lt;P&gt;Hope that's what you are looking for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 22:26:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-Conditional-Load/m-p/177301#M44976</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-11-09T22:26:09Z</dc:date>
    </item>
    <item>
      <title>Simple Conditional Load</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-Conditional-Load/m-p/177302#M44977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can achieve that using 2 steps.&lt;/P&gt;&lt;P&gt;First load the return transactions only.&lt;/P&gt;&lt;P&gt;Returns:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;field1, field2, field3, TrasactionID as returnID&lt;/P&gt;&lt;P&gt;from file.csv where &amp;lt;condition to get returns&amp;gt;&lt;/P&gt;&lt;P&gt;Then load the sales only and include the condition of "where not exists."&lt;/P&gt;&lt;P&gt;Sales_no_returns:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;field1, field2, field3, TrasactionID&lt;/P&gt;&lt;P&gt;from file.csv where &amp;lt;condition for sales only&amp;gt; and NOT EXISTS(returnID, TrasactionID);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 22:28:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-Conditional-Load/m-p/177302#M44977</guid>
      <dc:creator>boorgura</dc:creator>
      <dc:date>2010-11-09T22:28:39Z</dc:date>
    </item>
    <item>
      <title>Simple Conditional Load</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-Conditional-Load/m-p/177303#M44978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Of course you will have to drop the first table at the end.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 22:29:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-Conditional-Load/m-p/177303#M44978</guid>
      <dc:creator>boorgura</dc:creator>
      <dc:date>2010-11-09T22:29:18Z</dc:date>
    </item>
  </channel>
</rss>

