Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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

Re: Logic issue

Try like:

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

10 Replies
tresesco
Not applicable

Re: Logic issue

Try like:

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

SunilChauhan
Not applicable

Re: Logic issue

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

Not applicable

Re: Logic issue

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

Re: Logic issue

Try '=' instead of '<>'

neetha_p
Not applicable

Re: Logic issue

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

Re: Logic issue

Thank you Neetha.

preminqlik
Not applicable

Re: Logic issue

hi there,

May be in set analysis like this :

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

Not applicable

Re: Logic issue

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

Not applicable

Re: Logic issue

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