Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microstrategy Metric. Help!!

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I'm sorry because I'm Spanish, and I write very bad English
This is my problem:

I need create a new metric as:

if atribute.id equals 'DB' (string) then my
metric = Fact saldo * (-1)
else
metric = Fact Saldo
end if

May you help me??
 
you need to use the case functions: check out these technotes

TN5200-071-0120 - How to create metrics with 'CASE' expressions in MicroStrategy SQL Generation Engine 7.1 \
TN5300-7X0-0259 - Case and CaseV functions in the MicroStrategy 7 Analytical Engine
 
Thank you.
I think it runs OK now.
I maked a new fact with both fields using the Case and ApplySimple functions:

This is my fact:
ApplySimple("CASE WHEN #0 in ('DB') THEN ((-1)*#1)
WHEN #0 in ('HB') THEN #1
ELSE #1
END"; [field_atribute ]; field_SALDO)

And then I make the metric with it.

Thank you again.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top