<?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: Help in expression FOR LOST CUSTOMERS in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147419#M375299</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ali,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sure, I can try and find some time to do this - but I can't promise when it will be.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at your expression I would suggest you break it down into chunks, and use the aggr function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First create a table that will allow you to check your logic and validate your numbers.&amp;nbsp; Create a straight table, with CUSTOMER_KEY as the dimension.&amp;nbsp; Then create columns for Old Transactions (e.g. before cut off date) and Recent Transactions (after cut off).&amp;nbsp; You can then create a third column which is if(Old Transactions &amp;gt; 0 and Recent Transactions = 0 then 1 else 0) - rather than referencing the previous columns here re-use the expressions in the previous two columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you should have then is a flag in each row in the third column which will indicate whether or not that customer should be counted or not.&amp;nbsp; Make sure you have this working before you move on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will notice that the total on this third column will be 0 (as there will almost certainly be some old and some new transactions at a total level) rather than a count of customers.&amp;nbsp; I would try fixing this up in a fourth column.&amp;nbsp; The syntax for which is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(aggr((... expression from column 3 ...), CUSTOMER_KEY))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you should get is the same zeros and ones on each row, but the total should be a count of the customers who match the criteria.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now through the magic of AGGR you will be able to take that expression from the fourth column and use it against other dimensions and still get the correct result.&amp;nbsp; Google AGGR in QlikView to find out more about what it is doing here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that all makes sense and allows you to get to a working solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;BR /&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Aug 2016 09:29:08 GMT</pubDate>
    <dc:creator>stevedark</dc:creator>
    <dc:date>2016-08-10T09:29:08Z</dc:date>
    <item>
      <title>Help in expression FOR LOST CUSTOMERS</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147413#M375293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I want to get the count of lost customers;&lt;/P&gt;&lt;P&gt;they are the ones who had transactions before April 1st 2015 but after that date no more transactions are available for those customers:&lt;/P&gt;&lt;P&gt;I used the following expression:&lt;/P&gt;&lt;P&gt;note: &lt;SPAN style="font-size: 13.3333px;"&gt;vWon_Lost_Max_Date is 31/3/2016 and &lt;SPAN style="font-size: 13.3333px;"&gt;vTwelve_Months_Back_Selected_Date is 4/1/2015&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;count(distinct {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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; &lt;/P&gt;&lt;P&gt;&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; &amp;lt;&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp; TRANS_TYPE={'INVOICE'},WEEK=,YEAR=,MONTH=,MONTH_NUM=,DAY=,QUARTER=,MONTH_DAY=,MONTH_YEAR=,WEEK_DAY=,TRANS_DATE={'&amp;lt;=$(vWon_Lost_Max_Date)'}&lt;/P&gt;&lt;P&gt;&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; &amp;gt;&lt;/P&gt;&lt;P&gt;&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; -&lt;/P&gt;&lt;P&gt;&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; &amp;lt;&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp; CUSTOMER_KEY={"=count({&amp;lt; TRANS_TYPE={'INVOICE'},WEEK=,YEAR=,MONTH=,MONTH_NUM=,DAY=,QUARTER=,MONTH_DAY=,MONTH_YEAR=,WEEK_DAY=,TRANS_DATE={'&amp;gt;=$(vTwelve_Months_Back_Selected_Date) &amp;lt;= $(vWon_Lost_Max_Date)'}&amp;gt;}CUSTOMER_KEY)&amp;gt;0"}&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp; ,TRANS_TYPE={'INVOICE'},WEEK=,YEAR=,MONTH=,MONTH_NUM=,DAY=,QUARTER=,MONTH_DAY=,MONTH_YEAR=,WEEK_DAY=,TRANS_DATE={'&amp;lt;=$(vWon_Lost_Max_Date)'}&lt;/P&gt;&lt;P&gt;&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; &amp;gt;&lt;/P&gt;&lt;P&gt;&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; &lt;/P&gt;&lt;P&gt;&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; &lt;/P&gt;&lt;P&gt;&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;&amp;nbsp; }CUSTOMER_KEY)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the result of this expression is correct but when I put it in a pivot table with Dimension Customer_Key and Business_Unit_Name&lt;/P&gt;&lt;P&gt;the business unit name is always null&lt;/P&gt;&lt;P&gt;Same if I add Month_Year (from the calendar)&lt;/P&gt;&lt;P&gt;So with this expression I can only get result as numbers in a kpi but cannot have it aggregated by any dimension on a pivot table for example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;below is the schema please advise &lt;A href="https://community.qlik.com/qlik-users/96544"&gt;gwassenaar&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-users/61367"&gt;jp_bakhache&lt;/A&gt;‌ &lt;A href="https://community.qlik.com/qlik-users/164815"&gt;rodrigue.saade&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="133919" alt="screen_shot.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/133919_screen_shot.png" style="height: 349px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Ali Hijazi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 13:29:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147413#M375293</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2016-08-08T13:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147414#M375294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have Business Unit set for TRANS_TYPE = INVOICE in your fact table?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 14:59:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147414#M375294</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-08-08T14:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147415#M375295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;INDEED&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 15:19:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147415#M375295</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2016-08-08T15:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help in expression FOR LOST CUSTOMERS</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147416#M375296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The result of this expression is correct and when I filter by business unit I also correct result but when ever I add the business unit as dimension on a pivot table the value is always null&lt;/P&gt;&lt;P&gt;Same applies to month, or month_year dimension&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 19:54:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147416#M375296</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2016-08-08T19:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help in expression FOR LOST CUSTOMERS</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147417#M375297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could it be that the association for business unit name is only for recent records (i.e. those that you are excluding).&amp;nbsp; If any of the associations include date then this would be a distinct possibility?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 21:03:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147417#M375297</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2016-08-08T21:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help in expression FOR LOST CUSTOMERS</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147418#M375298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;Lost customers can be calculated in 2 ways:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;Suppose you select 2016 Jan and Feb&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;Then for Jan the lost customers are the ones who don't have invoice transactions between 1 Feb 2015 till 31 Jan 2016 but have at least one invoice from 31 Jan 2015 and backwards &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;And for Feb we count those who don't have transactions between 1 march 2015 till 28 Feb 2016&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;Or &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;For Jan&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;The max invoice date&amp;nbsp; for the customer is &amp;lt; 1 Feb 2015 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;And for Feb The max invoice date&amp;nbsp; for the customer is &amp;lt; 1 march 2015&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;if I share a sample document, would please help me?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2016 07:17:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147418#M375298</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2016-08-10T07:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: Help in expression FOR LOST CUSTOMERS</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147419#M375299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ali,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sure, I can try and find some time to do this - but I can't promise when it will be.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at your expression I would suggest you break it down into chunks, and use the aggr function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First create a table that will allow you to check your logic and validate your numbers.&amp;nbsp; Create a straight table, with CUSTOMER_KEY as the dimension.&amp;nbsp; Then create columns for Old Transactions (e.g. before cut off date) and Recent Transactions (after cut off).&amp;nbsp; You can then create a third column which is if(Old Transactions &amp;gt; 0 and Recent Transactions = 0 then 1 else 0) - rather than referencing the previous columns here re-use the expressions in the previous two columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you should have then is a flag in each row in the third column which will indicate whether or not that customer should be counted or not.&amp;nbsp; Make sure you have this working before you move on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will notice that the total on this third column will be 0 (as there will almost certainly be some old and some new transactions at a total level) rather than a count of customers.&amp;nbsp; I would try fixing this up in a fourth column.&amp;nbsp; The syntax for which is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(aggr((... expression from column 3 ...), CUSTOMER_KEY))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you should get is the same zeros and ones on each row, but the total should be a count of the customers who match the criteria.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now through the magic of AGGR you will be able to take that expression from the fourth column and use it against other dimensions and still get the correct result.&amp;nbsp; Google AGGR in QlikView to find out more about what it is doing here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that all makes sense and allows you to get to a working solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;BR /&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2016 09:29:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147419#M375299</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2016-08-10T09:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help in expression FOR LOST CUSTOMERS</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147420#M375300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the customer will be lost or not depending on the selection the user makes on year, and month&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2016 10:01:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147420#M375300</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2016-08-10T10:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help in expression FOR LOST CUSTOMERS</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147421#M375301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's fine, just make sure that your two variables are set based on selection, e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Date(AddMonths(max(TRANS_DATE), -3), 'DD/MM/YYYY')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is crucial that the variables return the date in the correct format that matches the 'natural' format of the date field.&amp;nbsp; This will be the format the date appears in a list box if you don't change anything on the Number tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Breaking down into separate chunks to validate as I mentioned above will make your Set Analysis simpler (i.e. you don't need two sets in one expression).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only other potential issue I can see in your code is that wildcard or partial matches in set analysis should be in double quotes rather than single.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2016 10:18:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147421#M375301</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2016-08-10T10:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Help in expression FOR LOST CUSTOMERS</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147422#M375302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ali,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Have you tried any thing along the lines of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Count({$&amp;lt;CUSTOMER_KEY = P({&amp;lt;TRANS_DATE = {"&amp;lt;01/05/2015"}&amp;gt;})&amp;gt;*&amp;lt;CUSTOMER_KEY = E({&amp;lt;TRANS_DATE = {"&amp;gt;=01/05/2015"}&amp;gt;})&amp;gt;}DISTINCT CUSTOMER_KEY)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good Luck&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2016 11:15:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147422#M375302</guid>
      <dc:creator>effinty2112</dc:creator>
      <dc:date>2016-08-10T11:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Help in expression FOR LOST CUSTOMERS</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147423#M375303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes I tried this&lt;/P&gt;&lt;P&gt;but the problem is that the transdate is dependant on the date value of the dimension&lt;/P&gt;&lt;P&gt;so the range for jan 2016 is feb 2015 till end of december 2015&lt;/P&gt;&lt;P&gt;for feb 2016 it is from Mar 2015 till end of Jan 2016 and so on&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2016 13:30:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147423#M375303</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2016-08-10T13:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: Help in expression FOR LOST CUSTOMERS</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147424#M375304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ali,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I now see your predicament!&amp;nbsp; You will not be able to pass the dimension value into the Set Analysis in order to give different date ranges on different rows of the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rather than having a date dimension you will need to create a separate expression for each month.&amp;nbsp; Each expression can then have a different date range for it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The neatest way of doing this is to put the code in a variable and pass parameters into the variable, giving an offset.&amp;nbsp; I've done an article on passing parameters into variables you may find useful:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.quickintelligence.co.uk/variables-parameters-load-script/" title="http://www.quickintelligence.co.uk/variables-parameters-load-script/"&gt;http://www.quickintelligence.co.uk/variables-parameters-load-script/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's quite fiddly to do, but it should allow you to achieve what you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first expression will be based on current month, so will have a parameter of 0 and you would need to use the AddMonths expression in the variable accordingly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, the expression would be something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(vExpLapsedCustomers(0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then the set analysis would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRANS_DATE={"&amp;gt;=$(=AddMonths(MonthStart(Max(TRANS_DATE)), -3-$1))"}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;TRANS_DATE={"&amp;gt;=$(=AddMonths(MonthStart(Max(TRANS_DATE)), -9-$1))&amp;lt;&lt;SPAN style="font-size: 13.3333px;"&gt;$(=AddMonths(MonthStart(Max(TRANS_DATE)), -3-$1))&lt;/SPAN&gt;"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;In both Set Analysis expressions the $1 will relate to the parameter (i.e. 0).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;You can then create a second expression that will have 1 as a parameter, i.e.:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;$(vExpLapsedCustomers(1))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Then repeat for as many months as you want to go back.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Hope that helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2016 13:55:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147424#M375304</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2016-08-10T13:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help in expression FOR LOST CUSTOMERS</title>
      <link>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147425#M375305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used the following variables in the expression that is available in the sample document I shared in my trial to get to the wanted results but all in vain&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 12pt; background-color: yellow; font-family: Calibri, sans-serif;"&gt;vWon_Lost_Max_Date&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #212121; font-family: 'Segoe UI', 'Segoe WP', 'Segoe UI WPC', Tahoma, Arial, sans-serif; font-size: 15px;"&gt;&lt;SPAN style="color: #1f497d; font-size: 11pt; font-family: Calibri, sans-serif;"&gt;=max({1&amp;lt;TRANS_TYPE={'invoice*'},YEAR=$::YEAR,MONTH=$::MONTH,DAY=$::DAY,WEEK=$::WEEK,MONTH_YEAR=$::MONTH_YEAR,QUARTER=$::QUARTER,MONTH_NUM=$::MONTH_NUM,WEEK_DAY=$::WEEK_DAY&amp;gt;} TRANS_DATE)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #212121; font-family: 'Segoe UI', 'Segoe WP', 'Segoe UI WPC', Tahoma, Arial, sans-serif; font-size: 15px;"&gt;&lt;SPAN style="color: #1f497d; font-size: 11pt; font-family: Calibri, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #212121; font-family: 'Segoe UI', 'Segoe WP', 'Segoe UI WPC', Tahoma, Arial, sans-serif; font-size: 15px;"&gt;&lt;SPAN style="color: #1f497d; font-size: 11pt; font-family: Calibri, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #212121; font-family: 'Segoe UI', 'Segoe WP', 'Segoe UI WPC', Tahoma, Arial, sans-serif; font-size: 15px;"&gt;&lt;SPAN style="color: black; font-size: 12pt; background-color: yellow; font-family: Calibri, sans-serif;"&gt;vWon_Lost_Max_Date_II&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #212121; font-family: 'Segoe UI', 'Segoe WP', 'Segoe UI WPC', Tahoma, Arial, sans-serif; font-size: 15px;"&gt;&lt;SPAN style="color: #1f497d; font-size: 11pt; font-family: Calibri, sans-serif;"&gt;MAX(AGGR(max({1&amp;lt;TRANS_TYPE={'invoice*'},YEAR=$::YEAR,MONTH=$::MONTH,DAY=$::DAY,WEEK=$::WEEK,MONTH_YEAR=$::MONTH_YEAR,QUARTER=$::QUARTER,MONTH_NUM=$::MONTH_NUM,WEEK_DAY=$::WEEK_DAY&amp;gt;} TRANS_DATE),MONTH_YEAR))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #212121; font-family: 'Segoe UI', 'Segoe WP', 'Segoe UI WPC', Tahoma, Arial, sans-serif; font-size: 15px;"&gt;&lt;SPAN style="color: #1f497d; font-size: 11pt; font-family: Calibri, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #212121; font-family: 'Segoe UI', 'Segoe WP', 'Segoe UI WPC', Tahoma, Arial, sans-serif; font-size: 15px;"&gt;&lt;SPAN style="color: #1f497d; font-size: 11pt; background-color: yellow; font-family: Calibri, sans-serif;"&gt;vTwelve_Months_Back_Selected_Date&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #212121; font-family: 'Segoe UI', 'Segoe WP', 'Segoe UI WPC', Tahoma, Arial, sans-serif; font-size: 15px;"&gt;&lt;SPAN style="color: #1f497d; font-size: 11pt; font-family: Calibri, sans-serif;"&gt;=ADDMONTHS(DATE($(vWon_Lost_Max_Date)),-12)+1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #212121; font-family: 'Segoe UI', 'Segoe WP', 'Segoe UI WPC', Tahoma, Arial, sans-serif; font-size: 15px;"&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="color: #1f497d; font-size: 11pt; font-family: Calibri, sans-serif;"&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d; font-size: 11pt; background-color: yellow; font-family: Calibri, sans-serif;"&gt;vTwelve_Months_Back_Selected_Date_II&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d; font-size: 11pt; font-family: Calibri, sans-serif;"&gt;AGGR((ADDMONTHS(DATE(MAX(AGGR(max({1&amp;lt;TRANS_TYPE={'invoice*'},YEAR=$::YEAR,MONTH=$::MONTH,DAY=$::DAY,WEEK=$::WEEK,MONTH_YEAR=$::MONTH_YEAR,QUARTER=$::QUARTER,MONTH_NUM=$::MONTH_NUM,WEEK_DAY=$::WEEK_DAY&amp;gt;} TRANS_DATE),MONTH_YEAR))),-12)+1),MONTH_YEAR)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d; font-size: 11pt; font-family: Calibri, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2016 11:53:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-in-expression-FOR-LOST-CUSTOMERS/m-p/1147425#M375305</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2016-08-11T11:53:08Z</dc:date>
    </item>
  </channel>
</rss>

