Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

count on rows in object

hi all,

i have the following challange:

i table diagram has (amongst others) a column that can either have the value 0, 1 or 2.

the value of this field is determined by a formula using some if statements.

so far, so good. i want to count all rows in this table that are 0, all rows that are 1 and all

rows that are 2 and store these numbers in a variable.

how can this be done ? can it be done at all ?

thanks,

regards,

K

3 Replies
its_anandrjs

Hi,

You have to check the values like

vVar1 = Count(If(Coulmn = 0 ,1,0))

vVar2 = Count(If(Coulmn = 1 ,1,0))

vVar3 = Count(If(Coulmn = 2 ,1,0))

For 0,1,2

Rgds

Anand

Miguel_Angel_Baeyens

Hi there,

You can use the label of the expression within another expression:

Sum(If([Count1] = 1, 1, 0))

Where [Count1] is the label of the expression used to count 0 values. You might try to transform those If() to set analysis without loss of information and use it in this another expression.

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

Not applicable
Author

@Anand: Thank for the reply, but where do i put this piece of code ? If i try this on a variable, i get the error msg that Column (i replaced it with my real column name used in the diagram object) is not a valid field name. Maybe its important to understand that the column with the 0,1, and 2s is based on a formula. This field does not exist in my data model.

@Miguel: Thanks a lot. This reads interesting. Can you clarify / explain please what you mean by "Where [Count1] is the label of the expression used to count 0 values." ? As i mentioned above: Thie field i am looking at is not part of my data model. I create it only in this diagram table.

hope my problem became clear....

thanks a lot!