Converting to String with Patterns

Here there,

Quick tip today: How to convert a value to String in a derived metric, for example, using patterns.

Let’s say that you have a date and you want to convert it to a string and get only the Month name with 3 chars. You just need to:

ToString<Pattern=mmm>([Date Attribute])

Get day with 2 numbers:

ToString<Pattern=dd>([Date Attribute]),

Get year with 4 numbers:

ToString<Pattern=yyyy>([Date Attribute])

Convert the value to 0,000 pattern:

ToString<Pattern=”0,000″>([Value metric])

Etc…

You can play around with these Patterns to convert your attributes/metrics to a string using a specific format.

Hope it helps.

God bless you!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.