Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
arun2305
Contributor III
Contributor III

Variables in Measures with a condition

Hi,

I want to measure something with a consition of variable.

My expression is :

count(distinct {<$(vExclusion_Scope)-='YES'>} Material)

Here "vExclusion_Scope" is a variable and contains "YES" values. And "Material" is a field.

But the formula isn't working, why ? Can you please help me ?

Thank you in advance.

Best regards, Arun

1 Solution

Accepted Solutions
pradosh_thakur
Master II
Master II

Is it working without the total
sum(aggr(if($(vExclusion_Scope)<>'YES',1,0),Material))
Learning never stops.

View solution in original post

4 Replies
pradosh_thakur
Master II
Master II

You have to use a field in the set analysis  before the   " = " 

You need to tell what is the expression for  vExclusion_Scope and in which object you are using it.

You might try the below but i would like you to show us something more to help you better.

sum(total aggr(if($(vExclusion_Scope)<>'YES',1,0),Material))
Learning never stops.
arun2305
Contributor III
Contributor III
Author

Hi Pradosh Thakur,

Thanks for your quick answer.

The formula is correct but it's not working for my case.

Actualy in the "Material" field I have dublicate value of material so I want to make a "count in distinct" of the materials. 

Here it is my variable field vExclusion_Scope :

if(
Material=Exclusion_Mat_PGI_Copy,Exclusion_LIVING_FLAG_SCOPE,

if(
Material<>Exclusion_Mat_PGI_Copy,LIVING_FLAG_SCOPE,

))

Thank you again.

pradosh_thakur
Master II
Master II

Is it working without the total
sum(aggr(if($(vExclusion_Scope)<>'YES',1,0),Material))
Learning never stops.
arun2305
Contributor III
Contributor III
Author

Thank you very much Pradosh Thakur,

It is working perfectly fine...

Best regards, Arun