EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB10218: How to create a count metric where the filter criteria is applied on an attribute which is in a lower level of the hierarchy as the lowest attribute on the report.


Community Admin

• Strategy


How to create a count metric where the filter criteria is applied on an attribute which is in a lower level of the hierarchy as the lowest attribute on the report.

A user would like to apply filter criteria to an attribute in a certain level of a hierarchy. For example, they would like to count all Call Centers per Region, which have more than $500,000 in revenue.
To achieve this, users must define a set qualification, based on the metric Revenue. To ensure that the “having” clause is applied at the level of the “Call Center” attribute, they must set the Output level, as shown in the following screen shot:

ka04W000000OghrQAC_0EM440000002Fky.jpeg

Now, they must place this filter into the metric:

ka04W000000OghrQAC_0EM440000002Fl0.jpeg

If they place this metric into a report with the attribute Region, for example, they obtain the desired results:

ka04W000000OghrQAC_0EM440000002Fku.jpeg

The SQL appears as follows:
Pass1 - Duration: 0:00:00.14
insert into ZZTXT0100ODMQ000
select a11. AS CALL_CTR_ID
from a11
group by a11.
having sum(a11.) > 500000.0
Pass2 - Duration: 0:00:00.12
select a11. AS REGION_ID,
max(a12.) AS REGION_NAME,
count(a11.) AS WJXBFS1
from a11,
pa1,
a12 where a11. = pa1. and
a11. = a12.
group by a11.
Pass3 - Duration: 0:00:00.04
drop table ZZTXT0100ODMQ000


Comment

0 comments

Details

Knowledge Article

Published:

June 12, 2017

Last Updated:

June 12, 2017