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

Announcements
Qlik Unveils New Agentic Capabilities Across Analytics, Data Engineering, and Trust: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Counting buyers that have bought last month/not bought for 3 months/not bought last 6 months

Hi all,

I'm trying to count the buyers that have bought first of all in the last month then the ones that havent bought in 3 months then the ones that havent bought in the last 6 or more months.

I've attached the chart I am trying to create and the expression I have so far is -

count(

if(

sum({<SOLD.YrMthSeq= {"<=$(=$(vRptYrMthSeqTY) -0) >=$(=$(vRptYrMthSeqTY) -1)"},UNIT.STOCKSTATUS = {'sold'}>} UNIT.TOTALSOLD) > 0,

BUYER.B_NO))

Inside the set analysis is the sold calendar, buyer.b_no is the unique buyers account number.

Any help would be greatly appreciated,

Thanks

Gareth

Labels (1)
2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Perhaps something like these:

count({<BUYER.B_NO=E({<BUYER.B_NO={'sum({<SOLD.YrMthSeq= {"<=$(=$(vRptYrMthSeqTY) -0) >=$(=$(vRptYrMthSeqTY) -3)"},UNIT.STOCKSTATUS = {"sold"}>} UNIT.TOTALSOLD) > 0'}>}BUYER.B_NO)>} BUYER.B_NO)

count({<BUYER.B_NO=E({<BUYER.B_NO={'sum({<SOLD.YrMthSeq= {"<=$(=$(vRptYrMthSeqTY) -0) >=$(=$(vRptYrMthSeqTY) -6)"},UNIT.STOCKSTATUS = {"sold"}>} UNIT.TOTALSOLD) > 0'}>}BUYER.B_NO)>} BUYER.B_NO)


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Hi Gysbert,

Thanks for this are you able to explain this a little more?