Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Attend QlikWorld 2020 and hear keynote speaker, Malcolm Gladwell. $300 savings extended to February 9th Learn More
Highlighted
darrihilmarsson
New Contributor III

Count function in QlikView

Hi, QlikView community

I using the count function to count containers in logistic company.

Here below is my datasets with four fields.

I am trying to count number of containers.

In this datasets I want the answear to be 3 containers. I want to know how many containers where used in every order for the whole time.

I know I can use Count (Distinct OrderID) to get the same result but I want to count the containers in the Containers field.

I was trying to use formula Count (Distinct Containers) but that is not possible because we use the same container for differenct Order ID in the dataset.

Do you guys know of any easy solution to count the containers so I can get 1 container for every month and when I sum the dataset I get 3 like in the formula Count (Distinct OrderID)

Regards Darri

   

PayerContainers                 OrderID  YrPer      
COCA-COLATGHU09683341002017-01
COCA-COLATGHU09683341002017-02
COCA-COLATGHU09683341002017-03
COCA-COLATGHU09683341002017-04
COCA-COLATGHU09683341002017-05
COCA-COLATRHU30705512002017-01
COCA-COLATRHU30705512002017-02
COCA-COLATGHU09683343002017-08
COCA-COLATGHU09683343002017-09
Tags (2)
1 Solution

Accepted Solutions

Re: Count function in QlikView

Try this

=Count(DISTINCT Containers&OrderID)

View solution in original post

3 Replies

Re: Count function in QlikView

but I want to count the containers in the Containers field.

Count of containers in the container field? Can you elaborate on this?

darrihilmarsson
New Contributor III

Re: Count function in QlikView

Hi,

what I mean is I want to count the numbers of container in the dataset and use the count function.

If I use Count (Containers) I will get total of 9 containers because there are 9 lines.

If I use Count (Distinct Containers) the answer will be 2 because there are two different containers in the dataset.

But I am looking to find numbers of containers that are used for every order ID.

I could use the formula Count( DISTINCT  OrderID) then I would get the answear I am looking for.

But I am looking for formula that counts the containers with the same result as counting the orderID

Re: Count function in QlikView

Try this

=Count(DISTINCT Containers&OrderID)

View solution in original post