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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Femke_DPG
Contributor III
Contributor III

Count when invoiced

Hello

How can I count the amount of offer numbers that have an invoice number? So in this example it has to be 2:

There are 3 offer numbers, but 2 of them are invoiced. 

Femke_DPG_0-1681474279257.png

I've tried this

if(isnull([Invoice: Invoice]),null(),count (distinct [Offer Number]))

but did not get the right result because it does not count DISTINCTS. It says 4 but has to be 2

Femke_DPG_0-1681476129487.png

 

 

Thanks for your help! 

 

 

Labels (3)
1 Solution

Accepted Solutions
sergio0592
Specialist III
Specialist III

Hi,

In a text box, try with :

=count(distinct {<Invoice={">0"}>}  Offer_number)

 

In a straight table , in the expression :

=aggr(count(distinct {<Invoice={">0"}>}  Offer_number),Offer_number)

 

 

View solution in original post

2 Replies
sergio0592
Specialist III
Specialist III

Hi,

In a text box, try with :

=count(distinct {<Invoice={">0"}>}  Offer_number)

 

In a straight table , in the expression :

=aggr(count(distinct {<Invoice={">0"}>}  Offer_number),Offer_number)

 

 

brunobertels
Master
Master

hi 

 

may be 

count ({<[Invoice: Invoice]-={null()}>}distinct [Offer Number]))

or

count ({<[Invoice: Invoice]-={'-'}>}distinct [Offer Number]))

or 

count ({<[Invoice: Invoice]-={'*'}>}distinct [Offer Number]))