Manage Learn to apply best practices and optimize your operations.

# New List Based On Portion Of List

Here is a fairly useful method of using formula language to pick out values
from a list of multiple values based on matching a "portion" of each element
without using a view.

Say you original list "List1" contains the following:

List1 := "Apples|Fruit|\$1.25" : "Oranges|Fruit|\$1.10" : "Peas|Vegatable|\$0.55"
: "Bannanas|Fruit|\$1.50" : "Tomatos|Debatable|\$0.95"

You want to create a new list of only those elements that are fruit.
List1 := "Apples|Fruit|\$1.25" : "Oranges|Fruit|\$1.10" : "Peas|Vegatable|\$0.55"
: "Bannanas|Fruit|\$1.50" : "Tomatos|Debatable|\$0.95"

List2 := @Word(List1;"|";2);
List3 := @Replace(List2; "Fruit"; "");
List4 := List1 + List3;
List5 := @Replace( List1; List4; "");
List6 := @Trim(@Replace(List1; List5; ""));

Now "List6" contains the final list and can be used like this:

@Word(List6;"|";1) + " - " + @Word(List6;"|";3)

giving you a fruit list like this -

Apples - \$1.25
Oranges - \$1.10
Bannana - \$1.50

*********************************
Optional Description of each step:
List1 - Original List
List2 - List of the second "words" in each element (Fruit, Fruit, Vagetable,
Fruit, Debatable)
List3 - List of seconnd words in element with one we want to keep Null
(,,Vegetable,Debatable)
List4 - Original List with "word 2" appended to change the elements we don't
want
Apples|Fruit|\$1.25
Oranges|Fruit|\$1.10
Peas|Vegatable|\$0.55Vegetable
Bannanas|Fruit|\$1.50
Tomatos|Debatable|\$0.95Debatable
List5 - Replaces the words that didn't change with Null to make a mask of what
to remove
,,Peas|Vegatable|\$0.55,,Tomatos|Debatable|\$0.95
List6 - (Final List) Use the mask to Null what we don't want and trim results
to remove Nulls from list.
This was last published in November 2000

#### Start the conversation

Send me notifications when other members comment.

## SearchWindowsServer

• ### Mastering PowerShell commands for Exchange by the book

This book works through common scenarios administrators face when managing Exchange Server 2016 and explains how to tackle them ...

• ### Breaking down the Exchange Online vs. on-premises choice

The continuous feature release model of Exchange Online might be a boon for some, but others might consider the need for constant...

• ### The top 5 unheralded Windows Server 2016 features

Windows Server 2016 is still a novel operating system for many administrators. Check out some of its new and enhanced features ...

## Search400

• ### iSeries tutorials

Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

• ### V6R1 upgrade planning checklist

When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

• ### Connecting multiple iSeries systems through DDM

Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

## SearchDataCenter

• ### Get to know SIEM software basics and benefits

Security information and event management tools give organizations enhanced network management functionality, such as automatic ...

• ### Plexxi buy bolsters HPE composable infrastructure strategy

HPE strengthened its composable infrastructure strategy with the acquisition of Plexxi, a startup that adds a networking element ...

• ### Hadoop cluster configuration best practices streamline workflows

Organizations that deal with a variety of Hadoop configurations can streamline workflows through baseline configuration, tests ...

## SearchExchange

• ### Cloud-based email security tools barricade entry to Exchange

The pressure is on Exchange administrators to avoid a ransomware outbreak that cripples the on-premises email system. Cloud-based...

• ### Migrating public folders requires extensive planning

Do your homework to find the right option for public folders when making a move to Exchange Online. Here are guidelines to help ...

• ### Using Microsoft Exchange certificates requires planning

Exchange certificates typically require minimal management effort after they have been set up, and they offer a secure means of ...

## SearchContentManagement

• ### Five areas to focus on in a SharePoint and GDPR compliance strategy

SharePoint admins need to be ready for the General Data Protection Regulation, too. Expert Reda Chouffani suggests five things to...

• ### Workplace collaboration tool bolsters employee productivity

The benefits of workplace collaboration tools trickle down to employee relationships, company growth, community engagement and ...

• ### New age collaboration tools empower the future of ECM

Document management, file-sharing and ECM platforms might represent 'ancient' 1990s technology, but AI and collaboration tools ...

Close