Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm trying to count how many buyers that have bought less than 300 units within the last 12 months.
Below is my expression but it isn't working, any help would be greatly appreciated. buyer b.no is the buyers id number.
count( DISTINCT if( sum(
{< UNIT.STOCKSTATUS={'sold'},
SOLD.YrMthSeq= {"<=$(=$(vRptYrMthSeqTY) -0) >=$(=$(vRptYrMthSeqTY) -11)"},
BUYER.B_IND_CAT = {'CS'} >} UNIT.TOTALSOLD) < 300,
BUYER.B_NO))
Thanks
Gareth
Try
count({<BUYER.B_NO = {"=sum( {< UNIT.STOCKSTATUS={'sold'},
SOLD.YrMthSeq= {'<=$(=$(vRptYrMthSeqTY) -0) >=$(=$(vRptYrMthSeqTY) -11)'},
BUYER.B_IND_CAT = {'CS'} >} UNIT.TOTALSOLD) < 300 "}>} DISTINCT BUYER.B_NO)
Try
count({<BUYER.B_NO = {"=sum( {< UNIT.STOCKSTATUS={'sold'},
SOLD.YrMthSeq= {'<=$(=$(vRptYrMthSeqTY) -0) >=$(=$(vRptYrMthSeqTY) -11)'},
BUYER.B_IND_CAT = {'CS'} >} UNIT.TOTALSOLD) < 300 "}>} DISTINCT BUYER.B_NO)
Brilliant thank you Gysbert!