Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Counting Multiple Values

Hi

I'm trying to write an expression which i can't seem to get to work, Its for a text Object, Please could someone advise what im doing wrong? Problem ID is a column of call reference numbers, and i just want to count all the calls with Open and Project Status? however when use the below it counts everything including calls with a status of Closed.

=Count( if(Status ='Open','Project',([Problem ID])) )

Any Help would be greatly appreciated

Thanks

Paul

1 Solution

Accepted Solutions
rustyfishbones
Honored Contributor II

Re: Counting Multiple Values

Check Dimension Limits and that you are not ticking the box to Show Others

2014-01-25_1402_001.png

7 Replies
MVP
MVP

Re: Counting Multiple Values

You have included 'Project' in your THEN branch, while you should use it in your condition, IMHO.

=count( if(Status = 'Open' or Status='Project', [Problem ID]))

or

=count( if(match(Status,'Open','Project'), [Problem ID]))

or

=count( {<Status = {Open, Project}>} [Problem ID])

Re: Counting Multiple Values

Hi

Try like this

=count( {<Status = {'Open', 'Project'}>} [Problem ID])

rustyfishbones
Honored Contributor II

Re: Counting Multiple Values

for performance,it's better to use the Set Analysis option

COUNT( {<Status = {'Open','Project'}>} [Problem ID])

Not applicable

Re: Counting Multiple Values

Thanks for your help, I have used =count( if(Status = 'Open' or Status='Project', [Problem ID]))

However when used in a pie chart with the same expression, it seems to be adding Others with zero? even though "Others" is not in any of the tables, Any ideas how to exclude or remove this info so it just shows Project and Open?

Qlikview.PNG.png

nilesh_gangurde
Valued Contributor

Re: Counting Multiple Values

See You are writing expression as if Status is Open then give Project Id else Give Problem ID, hence its not working.

=Count( if(Status ='Open','Project',([Problem ID])) )


instad of that you can write the following expression.


=Count( if(Status ='Open' or Status =  'Project',([Problem ID])) )

or

=Count( {<(Status ={'Open' ,  'Project'}>}[Problem ID]) )


Hope this will help.


-Nilesh

rustyfishbones
Honored Contributor II

Re: Counting Multiple Values

Check Dimension Limits and that you are not ticking the box to Show Others

2014-01-25_1402_001.png

Not applicable

Re: Counting Multiple Values

Thanks all for you help - Much Appreciated

Community Browser