<?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 Set Analysis in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-Analysis/m-p/1909045#M74941</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I am trying to achieve the below mentioned business logic using set analysis in qliksense&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Business logic&lt;/STRONG&gt; : If any order placed in a month (in last 36 months) before the current month selected and that there was no "A" type order placed before, and it is not the 1st time "A" type order placed, then the result should appear as "1".&lt;/P&gt;
&lt;P&gt;I am using the below mentioned set analysis, which is resulting in the customer who has not placed "A" type order also. Can you please guide me?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Script Used:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;//last B2B order by customer -----&lt;BR /&gt;if(&lt;/P&gt;
&lt;P&gt;COUNT({&amp;lt;&lt;BR /&gt;SalesChannel ={"B2B"},VolumeTypeCode = {"01"},&lt;BR /&gt;[Date] ={"&amp;gt;=$(=Date((AddMonths(Max([Date]),-36)),'DD/MM/YYYY'))&amp;lt;=$(=Date(AddMonths(monthend(Max([Date])),-1),'DD/MM/YYYY'))"},&lt;BR /&gt;VolumeHL = {"&amp;gt;0"},Revenue={"&amp;gt;0"} ,Year,MonthCode,Month&amp;gt;}DISTINCT ShipToCode)&lt;/P&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;P&gt;//new B2B customer&lt;BR /&gt;COUNT({&amp;lt;&lt;BR /&gt;SalesChannel={"B2B"},&lt;BR /&gt;[Date] = {"&amp;gt;=$(=Date(MonthStart(Max([Date])),'DD/MM/YYYY'))&amp;lt;=$(=Max([Date]))"},&lt;BR /&gt;VolumeTypeCode = {"01"},&lt;BR /&gt;ShipToCode -= P({1&amp;lt;SalesChannel={"B2B"},VolumeTypeCode = {"01"},Year,Month,MonthCode,&lt;BR /&gt;[Date] ={"&amp;gt;=$(=Date(YearStart(AddMonths(Max([Date]),-12)),'DD/MM/YYYY'))&amp;lt;=$(=Date(AddMonths(monthend(Max([Date])),-1),'DD/MM/YYYY'))"},&lt;BR /&gt;VolumeHL = {"&amp;gt;0"}&amp;gt;} ShipToCode),&lt;BR /&gt;VolumeHL = {"&amp;gt;0"},&lt;BR /&gt;Year,Month,MonthCode&amp;gt;} DISTINCT ShipToCode)&amp;gt;0,&lt;/P&gt;
&lt;P&gt;///current month selection with B2B order&lt;BR /&gt;COUNT({&amp;lt;&lt;BR /&gt;SalesChannel={"B2B"},VolumeTypeCode = {"01"},Year,Month,MonthCode,&lt;BR /&gt;[Date] = {"&amp;gt;=$(=Date(MonthStart(Max([Date])),'DD/MM/YYYY'))&amp;lt;=$(=Max([Date]))"},&lt;BR /&gt;VolumeHL = {"&amp;gt;0"},Revenue = {"&amp;gt;0"}&amp;gt;} distinct ShipToCode ))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Mar 2022 12:25:16 GMT</pubDate>
    <dc:creator>suryajeganathan</dc:creator>
    <dc:date>2022-03-25T12:25:16Z</dc:date>
    <item>
      <title>Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis/m-p/1909045#M74941</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I am trying to achieve the below mentioned business logic using set analysis in qliksense&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Business logic&lt;/STRONG&gt; : If any order placed in a month (in last 36 months) before the current month selected and that there was no "A" type order placed before, and it is not the 1st time "A" type order placed, then the result should appear as "1".&lt;/P&gt;
&lt;P&gt;I am using the below mentioned set analysis, which is resulting in the customer who has not placed "A" type order also. Can you please guide me?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Script Used:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;//last B2B order by customer -----&lt;BR /&gt;if(&lt;/P&gt;
&lt;P&gt;COUNT({&amp;lt;&lt;BR /&gt;SalesChannel ={"B2B"},VolumeTypeCode = {"01"},&lt;BR /&gt;[Date] ={"&amp;gt;=$(=Date((AddMonths(Max([Date]),-36)),'DD/MM/YYYY'))&amp;lt;=$(=Date(AddMonths(monthend(Max([Date])),-1),'DD/MM/YYYY'))"},&lt;BR /&gt;VolumeHL = {"&amp;gt;0"},Revenue={"&amp;gt;0"} ,Year,MonthCode,Month&amp;gt;}DISTINCT ShipToCode)&lt;/P&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;P&gt;//new B2B customer&lt;BR /&gt;COUNT({&amp;lt;&lt;BR /&gt;SalesChannel={"B2B"},&lt;BR /&gt;[Date] = {"&amp;gt;=$(=Date(MonthStart(Max([Date])),'DD/MM/YYYY'))&amp;lt;=$(=Max([Date]))"},&lt;BR /&gt;VolumeTypeCode = {"01"},&lt;BR /&gt;ShipToCode -= P({1&amp;lt;SalesChannel={"B2B"},VolumeTypeCode = {"01"},Year,Month,MonthCode,&lt;BR /&gt;[Date] ={"&amp;gt;=$(=Date(YearStart(AddMonths(Max([Date]),-12)),'DD/MM/YYYY'))&amp;lt;=$(=Date(AddMonths(monthend(Max([Date])),-1),'DD/MM/YYYY'))"},&lt;BR /&gt;VolumeHL = {"&amp;gt;0"}&amp;gt;} ShipToCode),&lt;BR /&gt;VolumeHL = {"&amp;gt;0"},&lt;BR /&gt;Year,Month,MonthCode&amp;gt;} DISTINCT ShipToCode)&amp;gt;0,&lt;/P&gt;
&lt;P&gt;///current month selection with B2B order&lt;BR /&gt;COUNT({&amp;lt;&lt;BR /&gt;SalesChannel={"B2B"},VolumeTypeCode = {"01"},Year,Month,MonthCode,&lt;BR /&gt;[Date] = {"&amp;gt;=$(=Date(MonthStart(Max([Date])),'DD/MM/YYYY'))&amp;lt;=$(=Max([Date]))"},&lt;BR /&gt;VolumeHL = {"&amp;gt;0"},Revenue = {"&amp;gt;0"}&amp;gt;} distinct ShipToCode ))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 12:25:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis/m-p/1909045#M74941</guid>
      <dc:creator>suryajeganathan</dc:creator>
      <dc:date>2022-03-25T12:25:16Z</dc:date>
    </item>
  </channel>
</rss>

