Abbreviate Function - GoToAssist Monitoring

GoToAssist Monitoring Service Status

Service Fully Operational

***Our GoToAssist maintenance window is Wednesday or Friday 6:00am-10:00am GMT. A maintenance generally results in 5-10 minutes of downtime during the beginning of the maintenance window.***

Updated: Wed, Oct 17 2012 2:27 PM RSS Feed

Find an Answer

Search GoToAssist Monitoring articles, videos and user guides   Your search term must have 2 or more characters.

Browse Articles

Abbreviate () function

abbreviate() — Limits the length of a string.

Syntax

The abbreviate() function returns a string and takes 3 parameters:

return value function(parameters)
string abbreviate(tree, string, string)

Return value

The abbreviate() function returns a string.

Description

The abbreviate() function limits the length of a string, and adds elipses to represent the missing content. You can use a third argument such as 'start', 'middle', or 'end'' to indicate which part of the string to remove.

Examples

You can run these examples against your own data in your GoToAssist search field, or against fictitious data in the Query Sandbox:

Example 1: Abbreviate from the middle

Query: Find and display names abbreviated from the middle.

SELECT abbreviate(name, 20, 'middle')
 FROM /network/device/wmi/win32_product  
              

This query abbreviates names that are greater than 20 characters long and adds an elipses to represent the missing characters.

Results: Depending on the database, this query returns results similar to this:

row
   abbreviate(name, 20, middle) Microsoft. . .90.2075)
row
   abbreviate(name, 20, middle) Advanced . . .ller 6.2
row
   abbreviate(name, 20, middle) Microsoft. . .lish) 12
row
   abbreviate(name, 20, middle) Microsoft. . .sh) 2007 
   . . .

Example 2: Abbreviate from the end

Query: Find and display names abbreviated from the middle.

SELECT abbreviate(name, 20, 'end')
 FROM /network/device/wmi/win32_product

This query abbreviates names from the end that are greater than 20 characters long, and adds elipses to represent the missing characters.

Results: Depending on the database, this query returns results similar to this:

row
   abbreviate(name, 20, end) Microsoft Platfor. . .
row
   abbreviate(name, 20, end) Advanced Installe. . .
row
   abbreviate(name, 20, end) Microsoft Softwar. . .
row
   abbreviate(name, 20, end) Microsoft Office. . .  
   . . .

Example 3: Abbreviate mailbox names

Query: Find and list the top mailboxes and abbreviate names longer than 30 characters.

SELECT abbreviate(mailboxdisplayname, 30) as "Name", 
    totalitems as "# Items", format(size * 1024, 
    'human_bytes') as Size 
 FROM /network/device/wmi/exchange_mailbox 
 order trees by size desc

This query abbreviates names from the end that are greater than 30 characters long, and adds elipses to represent the missing characters.

Results: Depending on the database, this query returns results similar to this:

row
   Name: Francisco GoToAssist
   # Items: 362
   Size: 7.83 MB
row
   Name: SystemMailbox{342BAD07-A159. . . 
   # Items: 265
   Size: 6.92 MB
row
   Name: SMTP (EXCHANGE-{342BAD07-A2. . . 
   # Items: 401
   Size: 361.00 KB
   . . .

To see other PQL functions, see Functions.

Related topics

| Views: 1356 | Last Updated: Thu, May 09 2013 2:28 PM

Is this article helpful?