Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Expression error

I have to show the list of customers with more than one invoice on the same day, I am able to show that by using the below expression

if(count({<datekey={'20180601'},CustomerCode>} DISTINCT InvoiceNumber)>1, CustomerName)

I need the TotalInvoiceAmount, but if am adding this column it is showing all the customers.

10 Replies
tripatirao
Creator II
Creator II

Do you wants to customer name in expression or dimension

are you using pivot table

and y are entering hard coding date.

Please elaborate ur requirement, it would be better if you provide the sample data

Anonymous
Not applicable
Author

Customer name is not must,but customer code.

Am using straight table.

The requirement is I have show an alert if any of the customer has invoiced more than once in same day(so date should be vtoday) after every reload.

shiveshsingh
Master
Master

Try in below format

=aggr(if(count({<datekey={'20180601'}>} DISTINCT InvoiceNumber)>1, CustomerCode),CustomerCode)

Anonymous
Not applicable
Author

I need the totalinvoiceamount for this customers.

sum(aggr(if(count({<datekey={'20180601'}>} DISTINCT InvoiceNumber)>1, CustomerCode),CustomerCode,TotalInvoiceAmount))

shiveshsingh
Master
Master

Can you share your app?

Anonymous
Not applicable
Author

test.png

Sorry I cannot share the app. These are the two customers having more than one invoice, but total invoice amount is 0

sasiparupudi1
Master III
Master III

May be try

Sum({1}(Aggr(sum({1} InvoiceAmount),CustomerCode))

or post some sample data

Anonymous
Not applicable
Author

try this ...

if(sum(aggr(count(distinct InvoiceNumber), CustomerCode, InvoiceDate)) > 1,

  sum(aggr(count(distinct InvoiceNumber), CustomerCode)) )

Anonymous
Not applicable
Author

I have added invoice amount. It should show A and C only but now showing all the three customers.