3 Replies Latest reply on Nov 8, 2018 1:36 PM by Santosh Kumar Budithi

# Hardcode measure value

Hi,

I would like hardcode measure values for certain dimensions. For example in the attached workbook, I want to create measure called as "Targets" that has values for Segment.

If([Segment]="Consumer") Then 560

ElseIf ([Segment]="Corporate") Then 460

ElseIf ([Segment]="Home Office") Then 360

ELSE null

END

But I am not able to get it to work. I know we can get it by having a secondary data source but any ideas on how we can do it in a single data source.

Thanks,

Arthi.

• ###### 1. Re: Hardcode measure value

Hi Arthi!

What specifically wasn't working for you? I opened your workbook and created a field using your formula (Calculation1). Then placed it on the worksheet as an attribute.

Is the attached what you are looking for? If not please let me know and I will continue to assist.

Tina

1 of 1 people found this helpful
• ###### 2. Re: Hardcode measure value

Dear Keat,

you can solve your issue in two way.

1) Approach 1: Drag the calculated Field into the row shelf and then right click on Arrow sign and select attribute.

2) Approach 2:Uncheck the Aggreegate measure (Analysis->aggregate mesaure)

Please let me know if you need any more information on the same.Please mark the answer as correct if it solves yoru problem.This will help other members when they are searching for solutions to similar problems.

• ###### 3. Re: Hardcode measure value

I tried the above method. Its working at line level.

But if I am trying to sum them or trying to show the totals for them, then its displaying asterisk.

How can we convert the constant values into pure measures?

Edit:
Found out the solution

Create a calc field, lets say "Segment Value"

If([Segment]="Consumer") Then 560

ElseIf ([Segment]="Corporate") Then 460

ElseIf ([Segment]="Home Office") Then 360

ELSE null

END

Now, create an LOD Calc field on top of this

{Fixed [Segment] : Avg(Segment Value)}

We can use this Calc as an Aggregated Value.