Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
We are aware of an issue with the Product Downloads page and looking into it.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

count function

Hi Experts,

i have the following table.

SALES:

LOAD Branch,

    Date,

    InvoiceNo,

    SalesAmt

FROM

QVD\SALES.qvd

(qvd);

i need to count the invoices whose sales value is above 40.00

there may be a scenario like

Invoice No    SalesAmt

01076249      17.95

01076249      17.95

01076249      10.00

i.e., all the above transactions is on one invoice, so the count should be 1.

i tried using the expresson

Count(DISTINCT if(sum(SalesAmt) > '40.00', InvoiceNo))

but its showing null values.

i dont know where the above expression is wrong.

Please help me on this

Labels (1)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

try to cget Count of all InvoiceNo instead of each single transaction

Count(DISTINCT if(aggr(sum(SalesAmt),InvoiceNo) > '40.00', InvoiceNo))

View solution in original post

4 Replies
Kushal_Chawda
MVP
MVP

try this

=Count(distinct{<InvoiceNo={"=sum(SalesAmt)>40"}>}InvoiceNo)

sunny_talwar
MVP
MVP

Try this may be:

=Count({<InvoiceNo = {"=Sum(SalesAmt) > 40"}>}DISTINCT InvoiceNo)

Anonymous
Not applicable
Author

try to cget Count of all InvoiceNo instead of each single transaction

Count(DISTINCT if(aggr(sum(SalesAmt),InvoiceNo) > '40.00', InvoiceNo))

sasiparupudi1
Master III
Master III

=Count({<InvoiceNo = {"=Sum(SalesAmt) > 40"}>}DISTINCT InvoiceNo)