Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I'm working with Qlikview to count the number of corporations which operates with my company.
Each operation, can have more than one company.
An example:
Nº of Operation Date Company
2 22/07 Company 1
2 22/07 Company 2
3 22/07 Company 1
4 23/07 Company 3
If I select the date = 22/07, and do a expression with count(Distinct (Company)), I receive the value = 2. This happens because the Qlikview counts only 2 companies, independent of the operations. But, I want the value = 3, because I have 2 companies in operation 2, and 1 in operation 3. The "Company 1" appeared in operation 2 and 3, but I want to count that company 2 times, not 1 like with count(distinct...).
Any solutions for this? With a expression like "distinct"? Or with a "If"? Or something else?
Thanks!
Try: =sum(aggr(count(distinct Company),[Nº of Operation])). See attached example.
Simply count(Company) will count the companies without removing duplicates.
Yes, but the real situation is this: I have many fields:
Operation -> Titles -> Date -> Company
An example:
Nº of Operation Title Date Company
2 54 22/07 Company 1
2 55 22/07 Company 2
2 56 22/07 Company 2
3 57 22/07 Company 1
4 58 23/07 Company 3
See? In operation 2, I have 3 titles and 2 companies. If I select operation 2, I want the value = 2, for number of the companies. But If i select operations 2 and 3, I want to see 3.
My boss is asking me for this: If I have the same company appeared 2 times in the same operation, the company have to be count only 1 time. But If the company appeared 2 times, but in different operations, the company have to be count 2 times.
Understand?
Try: =sum(aggr(count(distinct Company),[Nº of Operation])). See attached example.
Thanks man! Works perfectly!