How to Count delimiter items in string

More
1 year 5 months ago - 1 year 5 months ago #24734 by prashant
HI,
I have a column which contains string such as below , were I want to count number of items separated by delimiter 

1. 29779;29780;29781;29782;29783;29784. --> 6
2. 29979 -> 1
3. 29979;34343 -> 2

Can this be achieved any transformation rule?

Currently this can be achieved by using Calculations and my beloved python
Result.value = len([F001].split(';')) if [F001] else 0
 
Last edit: 1 year 5 months ago by prashant.

Please Log in or Create an account to join the conversation.

More
1 year 5 months ago #24737 by admin
Having thought about it I think the best approach is to create a a separate transformation function for it.

Should not take long

Mike
ETL Architect

Please Log in or Create an account to join the conversation.

More
1 year 5 months ago - 1 year 5 months ago #24762 by Peter.Jonson
Just letting you know that we added Count String Transformation function to the the latest release, we have also added some JSON actions,
we are currently helping one of our customers with ChatGpt integration and the are extremely useful. 

The total number of dynamic package actions is 136 and transformation functions is 551 now (And it will grow). 


 
Full list of changes

02/02/2025 6.4.5.8

 + Added: String To Json Dynamic Package Action
 + Added: Json To String Dynamic Package Action
 + Added: Get Json Object Property Dynamic Package Action
 + Added: Set Json Object Property Dynamic Package Action
 + Added: Json Array Loop Dynamic Package Action
 + Added: Json Object Loop Dynamic Package Action
 + Added: Timeout parameter to HTTP Dynamic Package Action
 + Added: Count String Transformation function
 + Updated: Demos 
 + Updated: Renamed Save Variable Dynamic Package Action to Save String
 - Fixed: Transformation tabs bug  
 - Fixed: HTTP Dynamic Package Action file upload bug 


 

Peter Jonson
ETL Developer
Last edit: 1 year 5 months ago by Peter.Jonson.

Please Log in or Create an account to join the conversation.

More
1 year 5 months ago #24771 by prashant
Hellos,

The calculations are right but we might need a flag to counter use case

Currently it's literally counting "presence" of a string , but what if we need the number of values separated by  said delimiter ";" 

So in my test case , see the output, whereas counting the

Tickets, Count , Expected Count

"3456","0" ,"1"
"3456;3456","1" ,"2" 
"3689;3459;3456;3456","3"  ,"4"
"3890 ; 34567 ; 34567; 34567","3" ,"4"

Hope this makes sense, my blooper video , where I was trying to showcase new feature

www.loom.com/share/0ca25a32dc414dcf9d3de...f2-8079-6f0d59df778a
The following user(s) said Thank You: admin

Please Log in or Create an account to join the conversation.

More
1 year 5 months ago #24773 by admin
That means that we have to create another transformation function.

And we will.

Mike
ETL Architect

Please Log in or Create an account to join the conversation.

More
1 year 5 months ago #24793 by Peter.Jonson

Please Log in or Create an account to join the conversation.

Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Read more
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Google
Accept
Decline
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Google Analytics
Accept
Decline
Functional
Tools used to give you more features when navigating on the website, this can include social sharing.
Advertisement
If you accept, the ads on the page will be adapted to your preferences.
Google Ad
Accept
Decline
Save