Manage Learn to apply best practices and optimize your operations.

New List Based On Portion Of List

Domino Resources - Part 6

Looking for something else?

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

• Creating PowerShell scripts for task automation

At a certain point, administrators who run PowerShell commands from the console will find it more efficient to develop a script ...

• Windows Defender Credential Guard secures login data

Windows Defender Credential Guard uses virtualization to isolate access to domain credentials and diminish the threat of attacks ...

March Patch Tuesday adds several more mitigations for the Spectre and Meltdown exploits, this time for 32-bit server and client ...

Search400

• iSeries tutorials

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

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

• IBM Cloud services to secure mainframes out to the edge

Big Blue will introduce IBM Cloud services that use blockchain, containers and its z14 mainframes to deliver improved security ...

• Four disadvantages of hyper-converged infrastructure systems

Problems with scalability and unexpected licensing costs can create problems for organizations that deploy hyper-converged ...

• IBM Power9 servers seek market inroads to AI, cloud

IBM follows up its first Power9 server with a raft of systems designed to appeal to a wider array of markets -- most notably, AI ...

SearchExchange

• Office 365 email encryption options grow for enterprise needs

Each enterprise has different needs when it comes to preventing data leakage. Admins should be aware of the Office 365 mailbox ...

Everyone wants a smooth patching process, but things can fall apart despite everyone's best efforts. Develop a solid recovery ...

• New Office 365 administrators grapple with challenges

More enterprises mulling the move to Office 365 should factor in the adjustments necessary to get the IT department up to speed ...

SearchContentManagement

• Scrivito unveils serverless CMS product

By building the CMS with ReactJS, Scrivito gained attraction with development community, according to an analyst.

• Content personalization tools sharpen focus on customers

Content personalization isn't new; Amazon weaponized it, and Jeff Bezos is the world's richest man. New tools are putting it ...

• Leading brands see the need for personalized content

Content personalization continues to expand within companies as maturing technologies make it a viable marketing option for ...

Close