MicroStrategy ONE

Count Compound Attribute

Count Compound Attribute is an advanced property that is hidden by default. For information on how to display this property, see Viewing and Changing Advanced VLDB Properties.

Compound attributes are usually counted by concatenating the keys of all of the attributes that form the key.

If your database platform does not support COUNT on concatenated strings, the Count Compound Attribute property should be disabled.

Levels at Which You Can Set This

Database instance only

Examples

COUNT expression enabled (default)

Copy
select a21.DIVISION_NBR DIVISION_NBR, 
max(a22.DIVISION_DESC) DIVISION_DESC, 
count(distinct char(a21.ITEM_NBR) || ||
char(a21.CLASS_NBR)) ITEM_COUNT 
from LOOKUP_ITEM a21 
join LOOKUP_DIVISION a22 
on (a21.DIVISION_NBR = a22.DIVISION_NBR) 
group by a21.DIVISION_NBR

COUNT expression disabled

Copy
create table TEMP1 as 
select distinct a21.DIVISION_NBR DIVISION_NBR, 
a21.ITEM_NBR ITEM_NBR, 
a21.CLASS_NBR CLASS_NBR 
from LOOKUP_ITEM a21 
select a22.DIVISION_NBR DIVISION_NBR, 
max(a22.DIVISION_DESC) DIVISION_DESC, 
count(a21.ITEM_NBR) ITEM_COUNT 
from TEMP1 a21 
join LOOKUP_DIVISION a22 
on (a21.DIVISION_NBR = a22.DIVISION_NBR) 
group by a22.DIVISION_NBR