Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Using Decode in Attribute

Using Decode in Attribute

Using Decode in Attribute

Hi - I'm new to MSTR and Oracle, and I'm trying to create an attribute and utilize the decode function in Oracle. What I want to do is - if a Region = "West Coast", then I want it to  = "WC".  How do I apply this in the attribute format?  thanks!

RE: Using Decode in Attribute

You need to use an applysimple statement in the attribute or fact editors.

If the syntax of DECODE is this:

DECODE(<value>, <statement1>, <directive1>, <directive_default>)

You will need to implement an applysimple that looks something like this:

ApplySimple("DECODE(#0, <statement1>, <directive1>, <directive_default>)", MSTR_Region)

#0 is the place holder for your attribute or fact.

This should get you started...for more info on how to do conditional formatting look at TN5200-071-0120 in the KBase.


RE: Using Decode in Attribute

thanks Chael - but another (stupid) question..is <statement1> what I want it to be (ie, "WC")?  Is <Directive1> what it is ("West Coast") and is <directive_default) also the same ("West Coast")?


RE: Using Decode in Attribute

Try this, altering my region for what you have as an attribute name:

ApplySimple("DECODE(#0,'West Coast','WC','East Coast','EC','Other')", region)

'Other' is the Default directive but it is not required.

I am not sure if this will work since I do not have an Oracle instance upon which to check this.  


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close