Jimmy Buck Posted May 13, 2013 Posted May 13, 2013 Hi All, I have not been on the forum for several years - hopefully I'm doing this correctly. I want to identify the Unique Invoice numbers assigned to a sales rep and then count how many Unique Invoice numbers there are. I need the count so a can generate the average value of each sale. Example (first 30 records): Rec - Sales Person Rec Num (Invoice) Summary Adam Cravens 2040122 Adam Cravens Adam Cravens 2040122 2040122 Adam Cravens 2040122 2040129 Adam Cravens 2040122 Total of two unique invoices Adam Cravens 2040122 Adam Cravens 2040122 Adam Cravens 2040122 Adam Cravens 2040122 Adam Cravens 2040122 Adam Cravens 2040122 Adam Cravens 2040122 Adam Cravens 2040122 Adam Cravens 2040122 Adam Cravens 2040122 Adam Cravens 2040129 Brian Aufdenberg 2040116 Brian Aufdenberg Brian Aufdenberg 2040116 2040116 Brian Aufdenberg 2040116 Total of one unique invoice Brian Aufdenberg 2040116 Brian Aufdenberg 2040116 Brian Aufdenberg 2040116 Brian Aufdenberg 2040116 Brian Aufdenberg 2040116 Brian Aufdenberg 2040116 Brian Aufdenberg 2040116 Brian Aufdenberg 2040116 Brian Aufdenberg 2040116 Brian Aufdenberg 2040116 Brian Aufdenberg 2040116 Thanks and Take Care Buck McCue
David Jondreau Posted May 13, 2013 Posted May 13, 2013 8.5 Advanced? Hm...from the Sales Rep table, you have a relationship based on Sales Rep ID? You could use List ( SalesRec::Invoice ) to grab all the Invoices for that Sales Rep. Then use a custom function to grab the unique values. Something like this: UniqueValues( values ) Let([ this.value = GetValue ( values ; 1) ; value.count = ValueCount ( values ) ; new.list = RightValues ( values ; value.count - 1) ; this.value = If ( IsEmpty ( FilterValues ( new.list ; this.value ) ) ; this.value ) ; pilcrow = If ( not IsEmpty ( this.value ) ; ¶ ) ; result = this.value & Case ( value.count > 1 ; pilcrow & UniqueValues ( new.list ) ) ] ; result )
Lee Smith Posted May 13, 2013 Posted May 13, 2013 If you have updated your version of FileMaker, please update your Profile to reflect this information. Here is a quick link to aide you MY PROFILE. Automatic messageThis topic has been moved from "Member Lounge" to "Calculation Engine (Define Fields)".
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now