<?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: Set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1534048#M600623</link>
    <description>&lt;P&gt;I'm sorry but I have not solved yet.&lt;BR /&gt;I send you the qvw in which I have uploaded data more consistent with reality.&lt;BR /&gt;First, the day difference must be applied to the line with the smallest date. I want to know how many days that quantity of that item remains in stock.&lt;BR /&gt;but the thing that I just can not do is reported as an example with the 03/03/2019 date for Item A, while for the Item BBB is reported with the date 20/03/2019.&lt;BR /&gt;I want them to become one line:&lt;BR /&gt;A - 3/3/2019 - 4 - 605&lt;BR /&gt;BBB - 20/03/2019 -125 - 10&lt;BR /&gt;just so I can calculate the days correctly.&lt;BR /&gt;give me another little big help?&lt;BR /&gt;thank you&lt;/P&gt;</description>
    <pubDate>Wed, 23 Jan 2019 18:55:50 GMT</pubDate>
    <dc:creator>francofiorillo</dc:creator>
    <dc:date>2019-01-23T18:55:50Z</dc:date>
    <item>
      <title>Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1533096#M600615</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;I would need help, please. These are days that I can not solve.&lt;BR /&gt;I have a database of all the warehouse movements related to the items in stock.&lt;BR /&gt;For each item I have a situation as reported in TAB1 (load the table with a Order By Item and Date).&lt;BR /&gt;First of all I have to know the existence at the date (DD / MM / YY) of each item.&lt;BR /&gt;For example, on 2/5/18 the value, for Item A, is equal to 3300.&lt;BR /&gt;I must do this.&lt;BR /&gt;First I choose two dates, for example: 2/5/18 and 30/3/19&lt;BR /&gt;Starting from 2/5/18, I have to calculate the days of stock of each &amp;lt;progr&amp;gt; (value to be calculated starting from the first movement in the table) and make the sum up to 30/3/19. Also I must add the Column (Progr * day)&lt;/P&gt;&lt;P&gt;Finally I have to apply the following formula:&lt;BR /&gt;&amp;nbsp;([sum of OUT] * [sum of Day]) / [sum of Progr * Day]&lt;BR /&gt;With the example data will be: (2650 * 339) / 1008000 = 0.89&lt;BR /&gt;Obviously, the items in a warehouse are many, on the same date there may be more movements for the same item and the user can choose the two dates as desired.&lt;/P&gt;&lt;P&gt;Thanks in advance for the help you want to give me.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:42:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1533096#M600615</guid>
      <dc:creator>francofiorillo</dc:creator>
      <dc:date>2024-11-16T04:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1533252#M600616</link>
      <description>&lt;P&gt;Are you planning to create Progr and day field in the script? or is this going to be created in the front end only?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 12:46:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1533252#M600616</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-01-22T12:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1533271#M600617</link>
      <description>&lt;P&gt;it would be very useful to do it in the script&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 13:09:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1533271#M600617</guid>
      <dc:creator>francofiorillo</dc:creator>
      <dc:date>2019-01-22T13:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1533277#M600618</link>
      <description>&lt;P&gt;Try this script&lt;/P&gt;&lt;PRE&gt;Table:
LOAD * INLINE [
    Item, Data, IN, OUT
    A, 1/1/18, 5000, 
    A, 10/3/18, , 700
    A, 1/4/18, , 600
    A, 3/4/18, , 800
    A, 6/4/18, , 100
    A, 14/4/18, 600, 
    A, 2/5/18, , 100
    A, 26/5/18, , 300
    A, 2/6/18, 300, 
    A, 16/6/18, , 150
    A, 1/1/19, , 
    A, 10/2/19, , 700
    A, 3/3/19, , 600
    A, 30/3/19, , 800
    A, 6/4/19, , 100
    A, 14/4/19, 600, 
    A, 2/5/19, , 100
    A, 26/5/19, , 300
    A, 2/6/19, 300, 
    A, 16/6/19, , 150
];

TempTable:
LOAD *,
	 If(Item = Previous(Item), RangeSum(Peek('CumIN'), IN), IN) as CumIN,
	 If(Item = Previous(Item), RangeSum(Peek('CumOUT'), OUT), OUT) as CumOUT,
	 RangeSum(If(Item = Previous(Item), RangeSum(Peek('CumIN'), IN), IN), -If(Item = Previous(Item), RangeSum(Peek('CumOUT'), OUT), OUT)) as Progr
Resident Table
Order By Item, Data;

FinalTable:
LOAD *,
	 If(Item = Previous(Item), Previous(Data) - Data, 0) as day
Resident TempTable
Order By Item, Data desc;

DROP Table Table, TempTable;
DROP Fields CumIN, CumOUT;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 845px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/4228iE2378B34E9D62856/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 13:29:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1533277#M600618</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-01-22T13:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1533301#M600619</link>
      <description>&lt;P&gt;It seems to me that this is what I want.&lt;BR /&gt;you are great !!!! thank you.&lt;BR /&gt;I ask you something else.&lt;BR /&gt;it happens that at the same date it has two distinct movements that I should combine first before counting the days.&lt;BR /&gt;do I have to do a group by?&lt;BR /&gt;Meanwhile, I thank you for the support.&lt;BR /&gt;I'm really grateful.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 14:03:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1533301#M600619</guid>
      <dc:creator>francofiorillo</dc:creator>
      <dc:date>2019-01-22T14:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1533309#M600621</link>
      <description>&lt;P&gt;I guess depending on what exactly you want, you can def. use Group By to combine multiple Item and Data combination before you create Progr and day fields.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 14:12:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1533309#M600621</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-01-22T14:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1534048#M600623</link>
      <description>&lt;P&gt;I'm sorry but I have not solved yet.&lt;BR /&gt;I send you the qvw in which I have uploaded data more consistent with reality.&lt;BR /&gt;First, the day difference must be applied to the line with the smallest date. I want to know how many days that quantity of that item remains in stock.&lt;BR /&gt;but the thing that I just can not do is reported as an example with the 03/03/2019 date for Item A, while for the Item BBB is reported with the date 20/03/2019.&lt;BR /&gt;I want them to become one line:&lt;BR /&gt;A - 3/3/2019 - 4 - 605&lt;BR /&gt;BBB - 20/03/2019 -125 - 10&lt;BR /&gt;just so I can calculate the days correctly.&lt;BR /&gt;give me another little big help?&lt;BR /&gt;thank you&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2019 18:55:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1534048#M600623</guid>
      <dc:creator>francofiorillo</dc:creator>
      <dc:date>2019-01-23T18:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1534049#M600625</link>
      <description>&lt;P&gt;I'm sorry but I have not solved yet.&lt;BR /&gt;I send you the qvw in which I have uploaded data more consistent with reality.&lt;BR /&gt;First, the day difference must be applied to the line with the smallest date. I want to know how many days that quantity of that item remains in stock.&lt;BR /&gt;but the thing that I just can not do is reported as an example with the 03/03/2019 date for Item A, while for the Item BBB is reported with the date 20/03/2019.&lt;BR /&gt;I want them to become one line:&lt;BR /&gt;A - 3/3/2019 - 4 - 605&lt;BR /&gt;BBB - 20/03/2019 -125 - 10&lt;BR /&gt;just so I can calculate the days correctly.&lt;BR /&gt;give me another little big help?&lt;BR /&gt;thank you&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2019 18:55:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1534049#M600625</guid>
      <dc:creator>francofiorillo</dc:creator>
      <dc:date>2019-01-23T18:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1534076#M600627</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/14420"&gt;@francofiorillo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;thing that I just can not do is reported as an example with the 03/03/2019 date for Item A, while for the Item BBB is reported with the date 20/03/2019.&lt;BR /&gt;I want them to become one line:&lt;BR /&gt;A - 3/3/2019 - 4 - 605&lt;BR /&gt;BBB - 20/03/2019 -125 - 10&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;but they are different Items with different dates, why do you want them to be on a single row? I am not sure I understand it completely? May be you need to use MonthYear as dimension instead of date?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2019 19:48:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1534076#M600627</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-01-23T19:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1534247#M600629</link>
      <description>&lt;P&gt;maybe I was not clear.&lt;/P&gt;&lt;P&gt;I want the result that I report in the attached "Result" table, starting from the initial Table.&lt;/P&gt;&lt;P&gt;I need to keep the "IN" and "OUT" values distinct for each date.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jan 2019 07:22:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1534247#M600629</guid>
      <dc:creator>francofiorillo</dc:creator>
      <dc:date>2019-01-24T07:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1534564#M600630</link>
      <description>&lt;P&gt;Try this script&lt;/P&gt;&lt;PRE&gt;Table:
LOAD Item,
	 Data,
	 Sum(IN) as IN,
	 Sum(OUT) as OUT
Group By Item, Data;
LOAD * INLINE [
    Item, Data, IN, OUT
    A, 20/06/2019, , 150
    A, 10/06/2019, 300
    A, 05/06/2019, , 300
    A, 30/05/2019, , 100
    A, 25/05/2019, 600
    A, 20/05/2019, , 100
    A, 30/03/2019, , 800
    A, 03/03/2019, , 5
    A, 03/03/2019, , 600
    A, 03/03/2019, 4
    A, 10/02/2019, , 700
    A, 01/01/2019, , 100
    A, 16/06/2018, , 150
    A, 02/06/2018, 300
    A, 25/05/2018, , 300
    A, 02/05/2018, , 100
    A, 14/04/2018, 600
    A, 06/04/2018, , 100
    A, 03/04/2018, , 800
    A, 01/04/2018, , 600
    A, 10/03/2018, , 700
    A, 02/02/2018, 5000
    BBB, 20/06/2019, , 150
    BBB, 08/06/2019, 100
    BBB, 02/06/2019, , 300
    BBB, 30/05/2019, , 100
    BBB, 25/05/2019, 600
    BBB, 20/05/2019, , 100
    BBB, 30/03/2019, , 800
    BBB, 20/03/2019, 25
    BBB, 20/03/2019, , 10
    BBB, 20/03/2019, 100
    BBB, 10/02/2019, , 700
    BBB, 01/01/2019, , 100
    BBB, 16/06/2018, , 150
    BBB, 02/06/2018, 100
    BBB, 25/05/2018, , 30
    BBB, 02/05/2018, , 100
    BBB, 14/04/2018, 200
    BBB, 06/04/2018, , 100
    BBB, 03/04/2018, , 40
    BBB, 01/04/2018, , 600
    BBB, 10/03/2018, , 70
    BBB, 02/02/2018, 10000
];

TempTable:
LOAD *,
	 If(Item = Previous(Item), RangeSum(Peek('CumIN'), IN), IN) as CumIN,
	 If(Item = Previous(Item), RangeSum(Peek('CumOUT'), OUT), OUT) as CumOUT,
	 RangeSum(If(Item = Previous(Item), RangeSum(Peek('CumIN'), IN), IN), -If(Item = Previous(Item), RangeSum(Peek('CumOUT'), OUT), OUT)) as Progr
Resident Table
Order By Item, Data;// desc;

FinalTable:
LOAD *,
	 If(Item = Previous(Item), Previous(Data) - Data, 0) as day
Resident TempTable
Order By Item, Data desc;

DROP Table Table, TempTable;
DROP Fields CumIN, CumOUT;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Jan 2019 15:04:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1534564#M600630</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-01-24T15:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1535113#M600632</link>
      <description>&lt;P&gt;ok.&lt;BR /&gt;that's what I wanted.&lt;BR /&gt;I thank you very much for your advice.&lt;BR /&gt;you have been very kind and professional.&lt;BR /&gt;Hello&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 12:59:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/1535113#M600632</guid>
      <dc:creator>francofiorillo</dc:creator>
      <dc:date>2019-01-25T12:59:52Z</dc:date>
    </item>
  </channel>
</rss>

