Help with Measure object

I need to create a measure object with muliple conditions in Designer.
ex.
Measure object name:Total_Salary

Select: salary

Where conditon:
Where empno in (100,200)
And
Where empno =100.

Basically I need to add salary twice to the Total_Salary where empno =100.

ex:
empno salary
100 1000
200 2000

result:
Total_Salary
4000

Any help appreciated.

Thanks in advance,
S


Sai Ram (BOB member since 2004-06-04)

Hi, Sai Ram, and welcome to BOB! :mrgreen:

When you are building the object, you have to create SQL that will work. A where clause that says “empno in (100,200) AND empno - 100” will only be true for those rows where empno equals 100.

There must be something else going on here – you’ll need to give more details about how one can figure out when to multiply a single row’s salary by 2.


Anita Craig :us: (BOB member since 2002-06-17)

Thanks Anita for quick response.

My requirement is to add the salary to Total_Salary object twice where empno=100.

I think this makes more clear.

Thanks in advance,
S


Sai Ram (BOB member since 2004-06-04)

Try in the select box of your universe object:

SUM
(
CASE WHEN EmployeeID = 100 THEN 2*Salary ELSE Salary END
)

Still wondering why you want to “double” someone’s salary :roll_eyes:


Andreas :de: (BOB member since 2002-06-20)

I don’t understand why you’d want to hard-code the doubling of a single salary, either. That’s why I thought there must be some unstated requirement / condition.


Anita Craig :us: (BOB member since 2002-06-17)

Jus hope I belong to that category :rotf:


Sridharan :india: (BOB member since 2002-11-08)