Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
All,
I have a table of data that contains a Product Code , Sales date ( date only no time) , Customer Name and Sales Qty In a QS table. I am pulling I the last Sales date( max) which works fine. However, as soon as I pull the customer name ( where there could be multiple customers purchasing on the same day) I get the line replicated per customer. How can I just pull just one customer ( as an example customer) . I know this sound strange but our Sales team just want to see a random customer for that day. I would have used Qty i.e Max Qty but this could be replicated as well on the same .
Any Ideas?
Can you share sample data?
Your expectation is to find the customer with max(date), like this?
Hi Jeff, maybe using rand with the number of different customers and use this to load only one customer
LET vCustomerIndex = Ceil(Rand()*FieldValuecount('CustomerCode'));
LET vCustomerCode = FieldValue('CustomerCode', $(vCustomerIndex));
RandomCustomer:
LOAD Fields
From/Resident
Where CustomerCode='$(vCustomerCode)';