<?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 Scripting Question in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Scripting-Question/m-p/1907637#M74798</link>
    <description>&lt;P&gt;hey all,&lt;/P&gt;
&lt;P&gt;i have the following problem: I have a table with multiple millions of records. Over a period of multiple years i have one record per customer, year and month and this customer's revenue:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;customer&lt;/TD&gt;
&lt;TD width="25%"&gt;year&lt;/TD&gt;
&lt;TD width="25%"&gt;month&lt;/TD&gt;
&lt;TD width="25%"&gt;revenue&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;customer_1&lt;/TD&gt;
&lt;TD width="25%"&gt;2019&lt;/TD&gt;
&lt;TD width="25%"&gt;01&lt;/TD&gt;
&lt;TD width="25%"&gt;100.000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;customer_1&lt;/TD&gt;
&lt;TD width="25%"&gt;2019&lt;/TD&gt;
&lt;TD width="25%"&gt;02&lt;/TD&gt;
&lt;TD width="25%"&gt;200.000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;customer_1&lt;/TD&gt;
&lt;TD width="25%"&gt;2019&lt;/TD&gt;
&lt;TD width="25%"&gt;03&lt;/TD&gt;
&lt;TD width="25%"&gt;150.000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;customer_1&lt;/TD&gt;
&lt;TD width="25%"&gt;2019&lt;/TD&gt;
&lt;TD width="25%"&gt;04&lt;/TD&gt;
&lt;TD width="25%"&gt;175.000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;customer_2&lt;/TD&gt;
&lt;TD width="25%"&gt;2019&lt;/TD&gt;
&lt;TD width="25%"&gt;01&lt;/TD&gt;
&lt;TD width="25%"&gt;120.000&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;customer_2&lt;/TD&gt;
&lt;TD&gt;2019&lt;/TD&gt;
&lt;TD&gt;02&lt;/TD&gt;
&lt;TD&gt;130.000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;customer_2&lt;/TD&gt;
&lt;TD&gt;2019&lt;/TD&gt;
&lt;TD&gt;03&lt;/TD&gt;
&lt;TD&gt;110.000&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;BR /&gt;The task is to identify each customer and year in which a given customer has a revenue below an amount X (i.e. 150.000) in &lt;STRONG&gt;every single month of a given&lt;/STRONG&gt; year. Following the minimum revenue of 150.000 customer_2 would be identified for the year 2019.&lt;/P&gt;
&lt;P&gt;Is there an elegant way to do some ground work in&amp;nbsp; the script to later on flag these customers (in a pivot table, where i have year (as row) and month (as column) as dimensions) ?&lt;/P&gt;
&lt;P&gt;Thanks a lot!&lt;BR /&gt;x&lt;/P&gt;</description>
    <pubDate>Mon, 21 Mar 2022 13:49:20 GMT</pubDate>
    <dc:creator>xyz_1011</dc:creator>
    <dc:date>2022-03-21T13:49:20Z</dc:date>
    <item>
      <title>Scripting Question</title>
      <link>https://community.qlik.com/t5/App-Development/Scripting-Question/m-p/1907637#M74798</link>
      <description>&lt;P&gt;hey all,&lt;/P&gt;
&lt;P&gt;i have the following problem: I have a table with multiple millions of records. Over a period of multiple years i have one record per customer, year and month and this customer's revenue:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;customer&lt;/TD&gt;
&lt;TD width="25%"&gt;year&lt;/TD&gt;
&lt;TD width="25%"&gt;month&lt;/TD&gt;
&lt;TD width="25%"&gt;revenue&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;customer_1&lt;/TD&gt;
&lt;TD width="25%"&gt;2019&lt;/TD&gt;
&lt;TD width="25%"&gt;01&lt;/TD&gt;
&lt;TD width="25%"&gt;100.000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;customer_1&lt;/TD&gt;
&lt;TD width="25%"&gt;2019&lt;/TD&gt;
&lt;TD width="25%"&gt;02&lt;/TD&gt;
&lt;TD width="25%"&gt;200.000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;customer_1&lt;/TD&gt;
&lt;TD width="25%"&gt;2019&lt;/TD&gt;
&lt;TD width="25%"&gt;03&lt;/TD&gt;
&lt;TD width="25%"&gt;150.000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;customer_1&lt;/TD&gt;
&lt;TD width="25%"&gt;2019&lt;/TD&gt;
&lt;TD width="25%"&gt;04&lt;/TD&gt;
&lt;TD width="25%"&gt;175.000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;customer_2&lt;/TD&gt;
&lt;TD width="25%"&gt;2019&lt;/TD&gt;
&lt;TD width="25%"&gt;01&lt;/TD&gt;
&lt;TD width="25%"&gt;120.000&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;customer_2&lt;/TD&gt;
&lt;TD&gt;2019&lt;/TD&gt;
&lt;TD&gt;02&lt;/TD&gt;
&lt;TD&gt;130.000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;customer_2&lt;/TD&gt;
&lt;TD&gt;2019&lt;/TD&gt;
&lt;TD&gt;03&lt;/TD&gt;
&lt;TD&gt;110.000&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;BR /&gt;The task is to identify each customer and year in which a given customer has a revenue below an amount X (i.e. 150.000) in &lt;STRONG&gt;every single month of a given&lt;/STRONG&gt; year. Following the minimum revenue of 150.000 customer_2 would be identified for the year 2019.&lt;/P&gt;
&lt;P&gt;Is there an elegant way to do some ground work in&amp;nbsp; the script to later on flag these customers (in a pivot table, where i have year (as row) and month (as column) as dimensions) ?&lt;/P&gt;
&lt;P&gt;Thanks a lot!&lt;BR /&gt;x&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 13:49:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Scripting-Question/m-p/1907637#M74798</guid>
      <dc:creator>xyz_1011</dc:creator>
      <dc:date>2022-03-21T13:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Question</title>
      <link>https://community.qlik.com/t5/App-Development/Scripting-Question/m-p/1907649#M74801</link>
      <description>&lt;P&gt;Perhaps this?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Sum(Aggr(Sum(TOTAL &amp;lt;year&amp;gt; revenue), Month))&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 13:54:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Scripting-Question/m-p/1907649#M74801</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2022-03-21T13:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Question</title>
      <link>https://community.qlik.com/t5/App-Development/Scripting-Question/m-p/1907719#M74811</link>
      <description>&lt;P&gt;Thanks a lot for your fast reply! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I would rather have something in the script done, like a new field that indicates for a customer and year whether the customer meets the 150.000 in every month of the year (or not)...any ideas how this could be done ?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 15:02:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Scripting-Question/m-p/1907719#M74811</guid>
      <dc:creator>xyz_1011</dc:creator>
      <dc:date>2022-03-21T15:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Question</title>
      <link>https://community.qlik.com/t5/App-Development/Scripting-Question/m-p/1907746#M74814</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;It's easy way that to do like&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Left Join(Main table)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Load Month, Year, Sum(revenue) as revenue, 1 as Flag&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Resident [Main table]&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Group by Month, Year;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 15:34:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Scripting-Question/m-p/1907746#M74814</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2022-03-21T15:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Question</title>
      <link>https://community.qlik.com/t5/App-Development/Scripting-Question/m-p/1907923#M74834</link>
      <description>&lt;P&gt;You could do something like this:&lt;/P&gt;
&lt;P class="p1"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;Data:&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;LOAD&lt;/SPAN&gt; customer&lt;SPAN class="s1"&gt;, &lt;BR /&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;year&lt;SPAN class="s1"&gt;, &lt;BR /&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;month&lt;SPAN class="s1"&gt;, &lt;BR /&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;revenue&lt;SPAN class="s1"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;FROM&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;&lt;BR /&gt;&lt;/SPAN&gt;[&lt;A href="https://community.qlik.com/t5/App-Development/Scripting-Question/td-p/1907637" target="_blank"&gt;https://community.qlik.com/t5/App-Development/Scripting-Question/td-p/1907637&lt;/A&gt;]&lt;SPAN class="s1"&gt;&lt;BR /&gt;(&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;html&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;, &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;utf8&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;, &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;UserAgent&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;is&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; 'Mozilla/5.0', &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;embedded&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;labels&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;, &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;table&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;is&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; @1);&lt;BR /&gt;&lt;BR /&gt;RevenueFlag:&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;Load&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&amp;nbsp; customer&lt;SPAN class="s1"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&amp;nbsp; year&lt;SPAN class="s1"&gt;,&lt;BR /&gt;&amp;nbsp; &lt;STRONG&gt;-(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN class="s2"&gt;max&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;(&lt;/SPAN&gt;revenue&lt;SPAN class="s1"&gt;) &amp;lt; 150) &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;as&lt;/SPAN&gt; Flag_BelowTarget&lt;/STRONG&gt;&lt;SPAN class="s1"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;Resident&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; Data&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;Group&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;By&lt;/SPAN&gt; customer&lt;SPAN class="s1"&gt;, &lt;/SPAN&gt;year&lt;SPAN class="s1"&gt;&lt;BR /&gt;;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Note this example leaves you with a valid synthetic key. I didn't deal with removing it because I didn't know where you want the flag to land in the end. But hopefully you can adapt to your actual model.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;-Rob&lt;BR /&gt;&lt;A href="http://www.easyqlik.com" target="_blank"&gt;http://www.easyqlik.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://masterssummit.com" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://qlikviewcookbook.com" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 23:24:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Scripting-Question/m-p/1907923#M74834</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2022-03-21T23:24:41Z</dc:date>
    </item>
  </channel>
</rss>

