Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculating Lost Buyers

Hi all,

I'm trying to calculate buyers that haven't purchased in the last 6 months across each month.

I've attached a chart that I am trying to produce in Qlikview. Ignore the lines. If you just look at the lost (red) bars for the moment, that is what I am trying to create.

Below are the fields I'm trying to use in the expression,

Unit.Sold_Date

Buyer.B_No

and my dimension is,

Unit.Sold_Month

So far I have

if(

  max(UNIT.SOLD_DATE)

  >

  max(addmonths(today,-6)), count(BUYER.B_NO)), count(Buyer.B_No))

However this will only show buyers that have bought within the last 6 months and not across all months.

Any help will be very much appreciated.

Thanks

Gareth

2 Replies
MK_QSL
MVP
MVP

Provide sample data to work !

Anonymous
Not applicable
Author

Unfortunately I cannot attached any sample data.

My Script is two tabs the first is -

LOAD

%_BNO,

UNIT.SOLD_MONTH

    

    

     FROM

    

[$(QVD_Path)\BUYER_unit.qvd]
(qvd);

and the second is -

  LOAD

%_BNO,

if(max( UNIT.SOLD_MONTH > AddMonths(UNIT.SOLD_MONTH,-3)),  %_BNO) as BUYER.ACTIVE

    

    

     FROM

    

  [$(QVD_Path)\BUYER_unit.qvd]

  (qvd)

      GROUP BY    %_BNO;