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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combined metrics question

Status
Not open for further replies.

26point2

Programmer
Jun 1, 2003
18
US
Hi MicroStrategy gurus:

Basically we developed two metrics, say metric A and metric B. For all product IDs, except product ID1,ID2,..,IDm, we'll use metric A, otherwise, use metric B.

We're trying to create another metric C that is the combination of metric A and B, so that users don't need to be worried about which metrics A or B to choose, the
combined metric C will automatically choose the right metric, depending on the input product ID.

Any ideas on how to build it?

Thanks,
26point2
 
You will need to embed the logic in a case statement in either a metric or a fact, depending on your fact table structures.

Please provide more info.
 
If you don't care about performance, then you can create copies of metric A and metric B with dimensionality of ReportLevel and Product. Then create metric C = Sum(ApplySimple("(case when #2 in ({list of comma separated products for which you want metric A}) then #0 else #1 end)",metric A,metric B,Product)).

The maintenance is a little easier with this implementation, but I still wouldn't recommend it. Embedding it in a fact is generally better.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top