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: 
Not applicable

Logic issue

Hi all ,

In the below customized report my expression showing wrong results.can any one help me on this

my exp: if(ELECTRICITY_DUTY=0,Count(distinct CONNECTION_NO))

what to do if I want to get only Electricity duty Not counted accounts with 0 symbol, Expression showing all accounts.

Screenshot (11).png

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

Count(distinct  If(ELECTRICITY_DUTY<>0, CONNECTION_NO))

View solution in original post

10 Replies
tresesco
MVP
MVP

Try like:

Count(distinct  If(ELECTRICITY_DUTY<>0, CONNECTION_NO))

SunilChauhan
Champion II
Champion II

Count(distinct  {<ELECTRICITY_DUTY-=0>}, CONNECTION_NO))

Sunil Chauhan
Not applicable
Author

Hi,

It is working fine ,but what to do if I want to show my result as 0 .Now it is showing as 1. My actual intention is to show them not to count.

Thanks,

JK

tresesco
MVP
MVP

Try '=' instead of '<>'

Anonymous
Not applicable
Author

Hi,

Try in expression:

Count( {<ELECTRICITY_DUTY-=0>}, distinct CONNECTION_NO)

or

In Script:

Load *,
if(len(Trim(ELECTRICITY_DUTY))= 0,0,1) as ELECTRICITYCOUNT

Resident table
group by CONNECTION_NO;

In Expression:

Count(  {< ELECTRICITYCOUNT = 1>}, CONNECTION_NO))

Regards

Neetha

Not applicable
Author

Thank you Neetha.

preminqlik
Specialist II
Specialist II

hi there,

May be in set analysis like this :

Count({<CONNECTION_NO={'=ELECTRICITY_DUTY<>0'}>} distinct CONNECTION_NO)

Not applicable
Author

'=' is the correct answer..Thank you.

Not applicable
Author

Your exp :Count( {<ELECTRICITY_DUTY-=0>}, distinct CONNECTION_NO) showing error some where.