<?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 Customer New or Repeat..problem with montly selection in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Customer-New-or-Repeat-problem-with-montly-selection/m-p/718498#M1079918</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;i've been working with Qlikview for about 1 month and i've a big problem in QlikView Customer Analysis.&lt;/P&gt;&lt;P&gt;The situation is:&lt;/P&gt;&lt;P&gt;i have only one table in .qvw in which every rows is an order done by a customer in a specific 'date_order'; by default every customer_id who has done an order has a relative column 'type_of_customers' = 'REPEAT'. The creation date of customer can be prior to 'date_order', and in the table are inserted as many rows as customers with 'creation_date' as 'date_order' and 'type_of_customers' = 'NEW'. Here is an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;ORDER_ID&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;CUSTOMER_ID&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;DATE_ORDER&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;TYPE CUSTOMER&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;QUANTITY&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2014/05/02&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;REPEAT&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2014/05/01&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;NEW&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;101&lt;/TD&gt;&lt;TD&gt;2014/05/20&lt;/TD&gt;&lt;TD&gt;REPEAT&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;101&lt;/TD&gt;&lt;TD&gt;2013/01/01&lt;/TD&gt;&lt;TD&gt;NEW&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the user select the Month of May the 'NEW' state must have priority on 'REPEAT' state: so i need to visualize 1 NEW CUSTOMER, 1 REPEAT CUSTOMER&amp;nbsp; and TOTAL QUANTITY = 3.&lt;/P&gt;&lt;P&gt;I have two important issue to fix:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I have a pie chart to represent '# of customers for type'. I create a variable to count the customers that are 'NEW' and 'REPEAT' in the time selected; this is the expression 'vNewCustomers =Count(distinct{&amp;lt;CUSTOMER_ID = {"=Count(Distinct TYPE_CUSTOMER)=2"}&amp;gt;}CUSTOMER_ID)'. In the chart expression I've added: &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;if(TYPE_CUSTOMER='REPEAT',&lt;/SPAN&gt; COUNT(DISTINCT CUSTOMER_ID)-(vNewCustomers)&amp;nbsp; ,COUNT(DISTINCT CUSTOMER_ID)).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;This solution is ok if the user doesn't click on a specific type of customer; in that case number of 'REPEAT' increases&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and it is&amp;nbsp; wrong. &lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I have to sum the quantity only for customer 101 because the customer 100, in the time selected, is 'NEW'.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Someone can help me??&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Romina&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone can help me?
Please it's very important!!

Romina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 05 Jul 2014 14:28:44 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-07-05T14:28:44Z</dc:date>
    <item>
      <title>Customer New or Repeat..problem with montly selection</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-New-or-Repeat-problem-with-montly-selection/m-p/718498#M1079918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;i've been working with Qlikview for about 1 month and i've a big problem in QlikView Customer Analysis.&lt;/P&gt;&lt;P&gt;The situation is:&lt;/P&gt;&lt;P&gt;i have only one table in .qvw in which every rows is an order done by a customer in a specific 'date_order'; by default every customer_id who has done an order has a relative column 'type_of_customers' = 'REPEAT'. The creation date of customer can be prior to 'date_order', and in the table are inserted as many rows as customers with 'creation_date' as 'date_order' and 'type_of_customers' = 'NEW'. Here is an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;ORDER_ID&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;CUSTOMER_ID&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;DATE_ORDER&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;TYPE CUSTOMER&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;QUANTITY&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2014/05/02&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;REPEAT&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2014/05/01&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;NEW&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;101&lt;/TD&gt;&lt;TD&gt;2014/05/20&lt;/TD&gt;&lt;TD&gt;REPEAT&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;101&lt;/TD&gt;&lt;TD&gt;2013/01/01&lt;/TD&gt;&lt;TD&gt;NEW&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the user select the Month of May the 'NEW' state must have priority on 'REPEAT' state: so i need to visualize 1 NEW CUSTOMER, 1 REPEAT CUSTOMER&amp;nbsp; and TOTAL QUANTITY = 3.&lt;/P&gt;&lt;P&gt;I have two important issue to fix:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I have a pie chart to represent '# of customers for type'. I create a variable to count the customers that are 'NEW' and 'REPEAT' in the time selected; this is the expression 'vNewCustomers =Count(distinct{&amp;lt;CUSTOMER_ID = {"=Count(Distinct TYPE_CUSTOMER)=2"}&amp;gt;}CUSTOMER_ID)'. In the chart expression I've added: &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;if(TYPE_CUSTOMER='REPEAT',&lt;/SPAN&gt; COUNT(DISTINCT CUSTOMER_ID)-(vNewCustomers)&amp;nbsp; ,COUNT(DISTINCT CUSTOMER_ID)).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;This solution is ok if the user doesn't click on a specific type of customer; in that case number of 'REPEAT' increases&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and it is&amp;nbsp; wrong. &lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I have to sum the quantity only for customer 101 because the customer 100, in the time selected, is 'NEW'.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Someone can help me??&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Romina&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone can help me?
Please it's very important!!

Romina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Jul 2014 14:28:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-New-or-Repeat-problem-with-montly-selection/m-p/718498#M1079918</guid>
      <dc:creator />
      <dc:date>2014-07-05T14:28:44Z</dc:date>
    </item>
  </channel>
</rss>

