<?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: How to write a script to define sales for each quarter in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-write-a-script-to-define-sales-for-each-quarter/m-p/1632580#M733464</link>
    <description>&lt;P&gt;Austria:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;code, company, market&lt;BR /&gt;15500140, 0, 0&lt;BR /&gt;15500140, 0, 0&lt;BR /&gt;15500140, 0, 0&lt;BR /&gt;15500140, 0, 0&lt;BR /&gt;15500140, 0, 0&lt;BR /&gt;15500140, 0, 0&lt;BR /&gt;15500140, 0, 0&lt;BR /&gt;15500140, 0, 0&lt;BR /&gt;15500140, 0, 0&lt;BR /&gt;15500240, 0, 0&lt;BR /&gt;15500240, 0, 0&lt;BR /&gt;15500240, 0, 0&lt;BR /&gt;15500240, 0, 0&lt;BR /&gt;15500240, 0, 0&lt;BR /&gt;15500240, 0, 0&lt;BR /&gt;15500240, 0, 0&lt;BR /&gt;15500240, 0, 0&lt;BR /&gt;15500240, 0, 0&lt;BR /&gt;15904001, 9000, 0&lt;BR /&gt;15904001, 0, 0&lt;BR /&gt;15904001, 0, 0&lt;BR /&gt;15904001, 0, 0&lt;BR /&gt;15904001, 0, 0&lt;BR /&gt;15904001, 0, 0&lt;BR /&gt;15904001, 0, 0&lt;BR /&gt;15904001, 0, 0&lt;BR /&gt;15904001, 0, 0&lt;BR /&gt;15904002, 0, 0&lt;BR /&gt;15904002, 7000, 0&lt;BR /&gt;15904002, 11000, 0&lt;BR /&gt;15904002, 8000, 0&lt;BR /&gt;15904002, 10000, 0&lt;BR /&gt;15904002, 7000, 0&lt;BR /&gt;15904002, 4000, 0&lt;BR /&gt;15904002, 0, 0&lt;BR /&gt;15904002, 0, 0&lt;BR /&gt;15904003, 1000, 0&lt;BR /&gt;15904003, 0, 0&lt;BR /&gt;15904003, 0, 0&lt;BR /&gt;15904003, 0, 0&lt;BR /&gt;15904003, 0, 0&lt;BR /&gt;15904003, 0, 0&lt;BR /&gt;15904003, 0, 0&lt;BR /&gt;15904003, 0, 0&lt;BR /&gt;15904003, 0, 0&lt;BR /&gt;1547, 30000, 2027000&lt;BR /&gt;1547, 20000, 3070000&lt;BR /&gt;1547, 18000, 2103000&lt;BR /&gt;1547, 18000, 2323000&lt;BR /&gt;1547, 13000, 1938000&lt;BR /&gt;1547, 19000, 2309000&lt;BR /&gt;1547, 10000, 1661000&lt;BR /&gt;1547, 0, 1715000&lt;BR /&gt;1547, 0, 1593000&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;LOAD *,&lt;BR /&gt;RowNo() as Row&lt;BR /&gt;Resident Austria;&lt;/P&gt;&lt;P&gt;New:&lt;BR /&gt;Load *,&lt;BR /&gt;If(Rowno()=46,company-(Peek(company,-9)+Peek(company,-18)+Peek(company,-27)+Peek(company,-36)+Peek(company,-45)),company-(Peek(company,-9)+Peek(company,-18)+Peek(company,-27)+Peek(company,-36)+Peek(company,-45)))as company_New,&lt;BR /&gt;&lt;BR /&gt;If(Rowno()=46,market(Peek(market,-9)+Peek(market,-18)+Peek(market,-27)+Peek(market,-36)+Peek(market,-45)),market-(Peek(market,-9)+Peek(market,-18)+Peek(market,-27)+Peek(market,-36)+Peek(market,-45)))as total&lt;BR /&gt;Resident Austria;&lt;BR /&gt;DROP Table Austria;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have loaded the data using Inline and used Peek function to define the sales.But when I am trying to write for whole data which has 17000 rows with different codes I am getting an error.&lt;BR /&gt;Can someone help me to derive for whole data, and If possible an idea to use which function&amp;nbsp;&lt;BR /&gt;peek,crosstable,Rowno() is also appreciated&lt;BR /&gt;waiting for your response!!&lt;/P&gt;</description>
    <pubDate>Tue, 08 Oct 2019 14:38:37 GMT</pubDate>
    <dc:creator>Sarath123</dc:creator>
    <dc:date>2019-10-08T14:38:37Z</dc:date>
    <item>
      <title>How to write a script to define sales for each quarter</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-write-a-script-to-define-sales-for-each-quarter/m-p/1626968#M733461</link>
      <description>&lt;P&gt;I have the data as attached below.&lt;/P&gt;&lt;P&gt;Lastime I calculated the sales based on the code by taking the sum of sales for the particular code&lt;/P&gt;&lt;P&gt;Now I am trying to caculate the sales for each quarter by using my caculated codes to find them&lt;BR /&gt;for code 3101 the sales should be sum of sales(3101)-sales(31010140)-sales(31010160)-sales(31010107)&lt;/P&gt;&lt;P&gt;for code 3201 the sales should be sum of sales (3201)-sales(32010140)-sales(32010160)-sales(32010107)&lt;/P&gt;&lt;P&gt;suppose for quarter Q2 2019 sales for both 3101&amp;amp;3201 should be exchanged with the caculated sales by using the above condition. I don't need the sum of sales instead for each quarter I need the sales value.&lt;BR /&gt;Like this I need to change my data for all the quarters (9quarters)with the new calculated values so that I can sum the sales values later&lt;BR /&gt;Can someone help me to define that on the script&lt;BR /&gt;My final output should be as&lt;BR /&gt;code&amp;nbsp; &amp;nbsp; &amp;nbsp; TU_company_QTR&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TU_Total_QTR&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;quarter&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; year&amp;nbsp;&lt;BR /&gt;3101&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xxxxxx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xxxxxx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Q2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2019&lt;BR /&gt;3101&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xxxxxx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xxxxxx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Q1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2019&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;&lt;BR /&gt;3101&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xxxxxx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xxxxxxx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Q2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2017&lt;BR /&gt;where&amp;nbsp; &amp;nbsp;xxxx will be the new calculated sales by using&amp;nbsp; below&amp;nbsp; condition&amp;nbsp;&lt;BR /&gt;3101 should be sum of sales(3101)-sales(31010140)-sales(31010160)-sales(31010107)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Can someone help me to define that on the script&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-write-a-script-to-define-sales-for-each-quarter/m-p/1626968#M733461</guid>
      <dc:creator>Sarath123</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a script to define sales for each quarter</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-write-a-script-to-define-sales-for-each-quarter/m-p/1627439#M733462</link>
      <description>&lt;P&gt;Can someone help me on my query please&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 12:56:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-write-a-script-to-define-sales-for-each-quarter/m-p/1627439#M733462</guid>
      <dc:creator>Sarath123</dc:creator>
      <dc:date>2019-09-24T12:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a script to define sales for each quarter</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-write-a-script-to-define-sales-for-each-quarter/m-p/1630583#M733463</link>
      <description>&lt;P&gt;Sarath, about the best I can do here is point you to the Design Blog area of Community, there are hundreds of posts here on how to do different things.&amp;nbsp; I am not exactly sure what you are trying to accomplish here, so I am going to give you the top level link, and there is a search box there you can use to try to find the posts that seem like they may help.&amp;nbsp; Best advice on search terms would be to start with a single word and see what you get back and then try to narrow from those results.&amp;nbsp; I believe you should be able to find at least a few posts that should be along the lines of what you want to do here that should help you possibly sort it out on your own at that point.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 15:04:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-write-a-script-to-define-sales-for-each-quarter/m-p/1630583#M733463</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-10-02T15:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a script to define sales for each quarter</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-write-a-script-to-define-sales-for-each-quarter/m-p/1632580#M733464</link>
      <description>&lt;P&gt;Austria:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;code, company, market&lt;BR /&gt;15500140, 0, 0&lt;BR /&gt;15500140, 0, 0&lt;BR /&gt;15500140, 0, 0&lt;BR /&gt;15500140, 0, 0&lt;BR /&gt;15500140, 0, 0&lt;BR /&gt;15500140, 0, 0&lt;BR /&gt;15500140, 0, 0&lt;BR /&gt;15500140, 0, 0&lt;BR /&gt;15500140, 0, 0&lt;BR /&gt;15500240, 0, 0&lt;BR /&gt;15500240, 0, 0&lt;BR /&gt;15500240, 0, 0&lt;BR /&gt;15500240, 0, 0&lt;BR /&gt;15500240, 0, 0&lt;BR /&gt;15500240, 0, 0&lt;BR /&gt;15500240, 0, 0&lt;BR /&gt;15500240, 0, 0&lt;BR /&gt;15500240, 0, 0&lt;BR /&gt;15904001, 9000, 0&lt;BR /&gt;15904001, 0, 0&lt;BR /&gt;15904001, 0, 0&lt;BR /&gt;15904001, 0, 0&lt;BR /&gt;15904001, 0, 0&lt;BR /&gt;15904001, 0, 0&lt;BR /&gt;15904001, 0, 0&lt;BR /&gt;15904001, 0, 0&lt;BR /&gt;15904001, 0, 0&lt;BR /&gt;15904002, 0, 0&lt;BR /&gt;15904002, 7000, 0&lt;BR /&gt;15904002, 11000, 0&lt;BR /&gt;15904002, 8000, 0&lt;BR /&gt;15904002, 10000, 0&lt;BR /&gt;15904002, 7000, 0&lt;BR /&gt;15904002, 4000, 0&lt;BR /&gt;15904002, 0, 0&lt;BR /&gt;15904002, 0, 0&lt;BR /&gt;15904003, 1000, 0&lt;BR /&gt;15904003, 0, 0&lt;BR /&gt;15904003, 0, 0&lt;BR /&gt;15904003, 0, 0&lt;BR /&gt;15904003, 0, 0&lt;BR /&gt;15904003, 0, 0&lt;BR /&gt;15904003, 0, 0&lt;BR /&gt;15904003, 0, 0&lt;BR /&gt;15904003, 0, 0&lt;BR /&gt;1547, 30000, 2027000&lt;BR /&gt;1547, 20000, 3070000&lt;BR /&gt;1547, 18000, 2103000&lt;BR /&gt;1547, 18000, 2323000&lt;BR /&gt;1547, 13000, 1938000&lt;BR /&gt;1547, 19000, 2309000&lt;BR /&gt;1547, 10000, 1661000&lt;BR /&gt;1547, 0, 1715000&lt;BR /&gt;1547, 0, 1593000&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;LOAD *,&lt;BR /&gt;RowNo() as Row&lt;BR /&gt;Resident Austria;&lt;/P&gt;&lt;P&gt;New:&lt;BR /&gt;Load *,&lt;BR /&gt;If(Rowno()=46,company-(Peek(company,-9)+Peek(company,-18)+Peek(company,-27)+Peek(company,-36)+Peek(company,-45)),company-(Peek(company,-9)+Peek(company,-18)+Peek(company,-27)+Peek(company,-36)+Peek(company,-45)))as company_New,&lt;BR /&gt;&lt;BR /&gt;If(Rowno()=46,market(Peek(market,-9)+Peek(market,-18)+Peek(market,-27)+Peek(market,-36)+Peek(market,-45)),market-(Peek(market,-9)+Peek(market,-18)+Peek(market,-27)+Peek(market,-36)+Peek(market,-45)))as total&lt;BR /&gt;Resident Austria;&lt;BR /&gt;DROP Table Austria;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have loaded the data using Inline and used Peek function to define the sales.But when I am trying to write for whole data which has 17000 rows with different codes I am getting an error.&lt;BR /&gt;Can someone help me to derive for whole data, and If possible an idea to use which function&amp;nbsp;&lt;BR /&gt;peek,crosstable,Rowno() is also appreciated&lt;BR /&gt;waiting for your response!!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2019 14:38:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-write-a-script-to-define-sales-for-each-quarter/m-p/1632580#M733464</guid>
      <dc:creator>Sarath123</dc:creator>
      <dc:date>2019-10-08T14:38:37Z</dc:date>
    </item>
  </channel>
</rss>

