Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

hammermill21
Contributor II

Multiple conditional counts in Set Analysis

Hello!

I am trying to count individual inventory items and have them sorted on my table. So each field is called:

[Inventory Bascom Item Type] and has Data like FIRE EXTINGUISHER, EXIT LIGHTS and I want to be able to count them all then have them sorted in my table.

I'm attaching a shot of my table and how it's has the items listed.

Thank you!!

7 Replies
devarasu07
Honored Contributor II

Re: Multiple conditional counts in Set Analysis

Hi,

you can try like this

=Count (Total <[Bascom Item Type]> [Inventory Bascom Item Type])


or


=Aggr(count(DISTINCT [Inventory Bascom Item Type]),[Bascom Item Type])


Regards,

Deva

hammermill21
Contributor II

Re: Multiple conditional counts in Set Analysis

Hey Deva,

Thank you. Though that does count the inventory it doesn't count the items individually. I want to be able to put a count for each items on the table.

vishsaggi
Esteemed Contributor III

Re: Multiple conditional counts in Set Analysis

What is your expected output?

hammermill21
Contributor II

Re: Multiple conditional counts in Set Analysis

What I want is on the first row for Battery operated egress lighting to show that count of the inventory, the next line would be the exit lights and so on. Make sense?

vishsaggi
Esteemed Contributor III

Re: Multiple conditional counts in Set Analysis

Yes, i mean what value are you expecting for that Item like if you count item for that item there is only one 1 value so the count will be 1, is this what you want to see?Can you share some sample file to look into?

hammermill21
Contributor II

Re: Multiple conditional counts in Set Analysis

I have attached a sample.

On the table labeled "UMHC-Bascom palmer eye institute" the last column should have the individual count for each "item type".

So for Battery operated egress lighting the total is 30, Exit lights is 307, fire extinguisher is 128 and that data is under the Inventory Bascom Item Type.

vishsaggi
Esteemed Contributor III

Re: Multiple conditional counts in Set Analysis

Your Bascom Item Type table and Inventory tables are not linked in your Data Model? Can you explain further?

Community Browser