Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

count(distinct(if(sales_88=1,[AR Invoice Number]))) How to make it return 2 ?

Hi All

I want to count how many create note ?
I have already have 2 create note , field name = sales_88

I assume the expression should look some thing like below :-
count(distinct(if(sales_88=1,[AR Invoice Number])))

But it display zero value.

Hope some can share with me how to make it display 2 ?

Paul Yeo

 

2 Solutions

Accepted Solutions
marcus_sommer

There is no value of 1 within sales_88 so I think you need to check your source-data.

- Marcus

View solution in original post

martinpohl
Partner - Master
Partner - Master

Hi,

I think you want to count if sales_88 = AR Invoice Number, so use

count(distinct(if(sales_88=[AR Invoice Number],[AR Invoice Number])))

Regards

View solution in original post

4 Replies
paulyeo11
Master
Master
Author

Hi All

Enclosed my QVW

marcus_sommer

There is no value of 1 within sales_88 so I think you need to check your source-data.

- Marcus

martinpohl
Partner - Master
Partner - Master

Hi,

I think you want to count if sales_88 = AR Invoice Number, so use

count(distinct(if(sales_88=[AR Invoice Number],[AR Invoice Number])))

Regards

paulyeo11
Master
Master
Author

Hi Sir

Your expression is right. also because you have spotted 2 credit note. 

=count( {< Year_n={1}, inv ={"=sales_88"}>} distinct inv)

Above is another solution i figure out.

Thank you very much

Paul