on 06-03-2014 6:10 AM
Hie Guys,
I have a object named "Manager ID" in my Universe. It is defined as a Dimension (Char). Now, I have created a Measure (Num) object in the Universe to count the Manager ID. The formula for the Measure Object is given below.
No. of Managers = Count(Select Manager ID) from Class A.
Now, in my Webi Report, I have 3 columns - Department Name, No. of Managers & Count(Manager ID).
The problem is - The column values for No. of Managers is not the same as Count(Manager ID) in the report.
Could anyone please help me understand the issue and suggest how to resolve it? Thanks.
Hi Jeewan,
As you are using count(manager_id) in the SQL, it is grouping the count as per the columns used in group by clause
and giving you the grouped count in report level.
At report level, you are simply counting distinct manager_ids; however, there is no grouping taking place as far as i understand.
Try this:
In one query, choose objects: Department Name, No. of Managers
Create another query: Department Name, Manager ID
Hope it will help.
Regards,
Yuvraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried your solution by setting the projection to none, but now I am getting the following output in Webi.
Dept Name | No. of Managers |
A | 1 |
A | 1 |
A | 1 |
B | 1 |
B | 0 |
C | 1 |
D | 1 |
I did a break on Dept Name and then Sum the total. But, it is still not matching Count(Manager ID) in Webi.
For some reason, Count(Distinct Table Name Manager ID) in the Universe is still counting duplicate IDs. The table is a derived table from MySQL database.
For some reason, Count(Distinct Table Name Manager ID) in the Universe is still counting duplicate IDs.
@ Universe if you use Count (DISTINCT Table. Field)
Data Type: Numeric
Projection Function: SUM
It's always gives correct results. maybe your something missing.
Can you provide the
SQL Code and screen-shot @ universe level
SQL Code and screen-shot @ SQL Developer
Count(Distinct table.field) should not use projection of sum
Consider the following:
I want to analyse customer purchases of products
January:
Customer A buys a shirt, a bag and a coat
Customer B buys a shirt and a coat
February:
Customer A buys two bags and a hat
Customer B buys a bag and two coats
I only have two customers in total but the projection of sum will take me well beyond this.
Column values for Dept A when using "Manager Count" object from Universe (Select Count Distinct & Projection as None)
Dept Name | Manager ID | Manager Count |
A | 100 | 1 |
101 | 1 | |
102 | 1 | |
102 | 1 | |
0 | ||
0 | ||
0 | ||
Sum: |
| 4 |
Column values for Dept A when using Count(Manager ID) in Webi:
Dept Name | Manager ID | Count(Manager ID) |
A | 100 | 1 |
101 | 1 | |
102 | 1 | |
0 | ||
Sum: |
| 3 |
As you can see in the 1st table, Manager Count -"Count Distinct Manager ID" object from the Universe is counting duplicate values for Manager ID = 102. Thus, the sum is not correct in table 1. Even when I set the Projection of Manager Count as Sum, it counts duplicate Manager IDs.
What projection are you using for your count object?
If you are using count, use sum
If you are using count distinct, use none.
Counting is not as straightforward as summing when it comes to balancing back to the universe.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Change the SQL code to below
@ Universe
Count (DISTINCT Table. Field)
Data Type: Numeric
Projection Function: SUM
@ WbI
Count(Distinct[Manager ID])
Create a new report and test showing both universe level measure and webI level measure getting same results or not
Still if you get difference, need to check Manager ID is compatibility with all the other object’s using in the webi results objects
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Normally it should you give same results. If manger id is compatibility with Department name..
First you need to find out which results are correct(universe level/webi level) with checking database.?
Dep Name | No . of Managers |
abc | 1 |
xyz | |
1 | |
Sum 2 |
Dep Name | Count(Manager ID) |
abc | 1 |
xyz | 1 |
1 | |
Sum 3 |
Dep Name | No . of Managers | Count(Manager ID) |
abc | 1 | 1 |
xyz | 1 | |
1 | 1 | |
Sum 2 | Sum 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.