Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
rittermd
Master
Master

Expression to get number of invoices with 2 or more suffixes

So I am ingesting invoice data.  The first time an invoice is created it has no suffix.  Then each time it is updated a new suffix is assigned (A, B, C, etc.).

I can count how many suffixes an invoice has and store that in the load script in a field.  But the user wants this to be interactive in the dashboard.  For example an invoice might be created in March.  Have a suffix created in March, April, and again in May.  If the user filters on May they want to only see invoices that had 2 or more in that month.  So this invoice might have a total of 7 for example since it was first created.  But 2 were created in May.  I would then want to count this invoice.  But if 1 or 0 were created in May then I would not want to count this invoice.

I have tried several iterations but nothing has worked so far:

//Count({<[Billing Invoice Number~Suffix] = {"=Len(Trim([Invoice Suffix])) > 0"}>} DISTINCT [Billing Invoice Number~Suffix])

//count({<{"Len([Invoice Suffix])>1"}>} DISTINCT [Billing Invoice Number])

//count({<[Billing Invoice Number] = {"=Count(Len([Invoice Suffix])>1)>1"}>} DISTINCT [Billing Invoice Number])

I am thinking I may need to use some combination of AGGR with Count?

Any guidance would be greatly appreciated.

1 Solution

Accepted Solutions
GaryGiles
Specialist
Specialist

Try this:

=count({$<[Billing Invoice Number]={"=count({$<[Invoice Suffix]-={''}>} [Invoice Suffix])>1"}>}distinct [Billing Invoice Number])

View solution in original post

1 Reply
GaryGiles
Specialist
Specialist

Try this:

=count({$<[Billing Invoice Number]={"=count({$<[Invoice Suffix]-={''}>} [Invoice Suffix])>1"}>}distinct [Billing Invoice Number])