8 Replies Latest reply: Sep 25, 2016 4:54 AM by Linoy Elias

# Using measures in calculated expression

Hi, is it possible to use a measure in a calculated expression?

Or I have to create a variable?

• ###### Re: Using measures in calculated expression

Hi,

You can use measure in calculated expression..also using a variable..

What is the actual requirement.?

• ###### Re: Using measures in calculated expression

Just asking what is the syntax.

For example, if I have a measure Profit YTD and I wand to use it in a calculated expression in Set Analysis.

• ###### Re: Using measures in calculated expression

You can use  the expression as it is shown in image by storing set analysis part in variable and thrn using variable in expression

Else you can use actual expression as sample expression shown below

Sum({<OrderDate ={">=\$(=max(YearStart)) <=\$(=max(OrderDate)) "}>}   Profit)

It depends on expression complexity whether you need to use variable or actual expression.

Regards,

• ###### Re: Using measures in calculated expression

So there is no way to use the measure I've already defined in expression and I have either to create a variable or just write down the whole thing in an expression. is that right?

• ###### Re: Using measures in calculated expression

U can define the expression in master as u have created also with the syntax in my earlier reply.

Then just drap and drop that measure in chart or select from the list while creating a chart in measure section.

But you can not use master measure in another expression

• ###### Re: Using measures in calculated expression

I need to use the measure in Set analysis in expressionm for example for column color: for example,

If Profit YTD <100, then color the column in red.

I guess, I'll just need to add it as a variable.

Thought maybe there was a workaround for not adding the same calculation twice: once for the measure and once in a variable...

• ###### Re: Using measures in calculated expression

That is not possible.. Best way to do this is using variable.

• ###### Re: Using measures in calculated expression

OK