Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
Aggregation Count different from SQL Count
Migrateduser
Hi all, I have a table named wintelCosts, and the columns of interest for me in this table are activityStatus and serverPurpose.<br />
<br />
Fields in the column serverPurpose range from 'Application' to 'Infrastructure' to 'Web', among others, and activityStatus are either 'Active', 'Not Active', or 'Decommissioned'. <br />
<br />
I want to find out, say, how many active Wintel servers are there having serverPurpose = 'Application', so I try it out first using the Data Set SQL Query:<br />
<br />
<span style='font-family: Courier New'>select count(*) as ApplicationCount<br />
from wintelCosts<br />
where activityStatus = 'Active' and serverPurpose = 'Application'</span><br />
<br />
Which has an output of 191, which is what I want.<br />
<br />
However, I have to come up with a count output for all of these combinations ('Application' and active, 'Infrastructure' and active, etc.), so I start looking for a computed column solution. I create a computed column called ApplicationCount, and edit my SQL Query to be this:<br />
<br />
<br />
<span style='font-family: Courier New'>select * from wintelCosts</span><br />
<br />
The computed column has an integer DataType, a COUNT aggregation, and both the expression and filter (I still don't know the difference between the two) are set to <br />
<br />
<span style='font-family: Courier New'>row["serverPurpose"] == 'Application' && row["activityStatus"] == 'Active'</span><br />
<br />
And I get a count of 189, 2 fewer than the correct count. I have no idea why this is happening, could anyone help me out here? Thank you!
Find more posts tagged with
Comments
There are no comments yet