Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
dimak123
Partner - Contributor III
Partner - Contributor III

Count items for invoice

Good day,

need some help with aggregations:

I want to show a list of clients and to see how many invoices(just count) contained only one item, 2 items, 3 items and 4.

this is my data:

  

CustomerIdInvoiceIdInvoiceLineItemIdQuantity
10023701390082_INV3106920162
10023701390082_INV4106920161
10023701390082_INV5106920162
10023701390082_INV6106920162
10023701390082_INV7106920162
10023701390082_INV8106920162
10008301390090_INV1102810044
10008301390090_INV2106920161
10008301390090_INV3102810042
10008301390090_INV4102810042
10008301390090_INV5102810041
10008301390090_INV6102810044
10008301390090_INV7102810044

many thanks a head

13 Replies
Not applicable

Hi Dima,

As per the given input are you expecting the output like below?

CustomerId

1 item for Invoice2 items for Invoice3 items for Invoice4 items for Invoice
1002371500
1000831203

Thanks,

Sreeman

tresesco
MVP
MVP

Try expressions like:


For 1 Item Invoices:

Count({<InvoiceId={"=Count(Distinct ItemId)=1"}>} Distinct InvoiceId)

For 2 Item Invoices:

Count({<InvoiceId={"=Count(Distinct ItemId)=2"}>} Distinct InvoiceId)

....

sasikanth
Master
Master

hi,

Did you check my attachement ?

PradeepReddy
Specialist II
Specialist II

see the attachment.., it might be helpful..