# Process string transformation and math formula

**URL:** <https://forum.knime.com/t/process-string-transformation-and-math-formula/38364>\
**Category:** KNIME Analytics Platform\
**Created:** [December 22, 2021, 7:08am UTC](https://forum.knime.com/t/process-string-transformation-and-math-formula/38364 "2021-12-22T07:08:51Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kenyx](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/7ba0ec/32.png) [@Kenyx](https://forum.knime.com/u/Kenyx)\
**Post date:** [December 22, 2021, 7:08am UTC](https://forum.knime.com/t/process-string-transformation-and-math-formula/38364/1 "2021-12-22T07:08:51Z")

</div>

Hi All,  
I am a new knimer also university student from China, after the learning of self-paced online courses, I started a data mining internship. But I met some problems.  
Currently, I was working on multiple parameter’s tolerance correlation. The tolerance is name from Tolerance, Tolerance #1, Tolerance #2 and so on. Its string format is like 2.2…4.2 (float number + delimiter… + float number). Then I need to use math formula to process the (practical result - lower bound and upper bound) / (lower bound and upper bound), later may try with the standard deviation.

Problem:

1. As there are more than 30 tolerance parameters, is there any easy method (like loops or flow variable) to process each Tolerance one by one,?

I try to use String manipulation, Cell splitter, Column splitter and Loops (Column list loop, Group loop, Chunk loop) but I still can not process.

1. Is there any easy method (like loops or flow variable) to process each Math formula?

Some links may help:

> **[Looping over all columns and manipulation of each – knime](https://hub.knime.com/knime/spaces/Examples/06_Control_Structures/04_Loops/03_Looping_over_all_columns_and_manipulation_of_each~Ck4Q3ZW7PEUAyl4L/current-state)**
>
> The workflow iterates over all numeric columns and negates the values in the column. The loop takes one column at a time, renames the column name to ANONYMOUS\_…

> [@Math formula, Condition data for clustering](https://forum.knime.com/t/math-formula-condition-data-for-clustering/11797):
>
> Hello All, I am trying to condition my data sheet for cluster analysis and am coming from R and Excel transitioning to knime. I have a full matrix of different organism and there counts. I need to add 1 to ever cell for each column then standardize the whole data sheet (logarithmicly) relative to reach other to find significant. I am struggling to understand the the math formula node. Most of the examples are only changing 1 column and I have about 40. What would my steps be? Thank you, M …

---

<div class="post-metadata">

**Author:** ![gonhaddock](https://forum-cdn.knime.com/user_avatar/forum.knime.com/gonhaddock/32/35425_2.png) [@gonhaddock](https://forum.knime.com/u/gonhaddock)\
**Post date:** [December 22, 2021, 6:44pm UTC](https://forum.knime.com/t/process-string-transformation-and-math-formula/38364/2 "2021-12-22T18:44:38Z")

</div>

Hi @Kenyx  
It is hard to imagine how it looks like the structure of your data. Many questions arise in my head:

- Do you want to process one column at every iteration o a group of columns together?
- Are the name of the Columns somehow nested and systematize?

Would it be great if you can provide us with some data (not necessarily the real one) arranged in the way of your source. Some example with your desired output would be great as well.

I have some ideas but not necessarily they meet your needs with this limited information.

BR

---

<div class="post-metadata">

**Author:** ![Kenyx](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/7ba0ec/32.png) [@Kenyx](https://forum.knime.com/u/Kenyx)\
**Post date:** [December 23, 2021, 1:50am UTC](https://forum.knime.com/t/process-string-transformation-and-math-formula/38364/3 "2021-12-23T01:50:25Z")

</div>

The structure of data sample screenshot is as the attachment.  
One column and a group of columns are both acceptable.  
The columns are systematized, each tolerance column is next to the parameter column.

 ![2021-12-23_09h45_29](https://forum-cdn.knime.com/uploads/default/original/3X/e/d/ed08017d792cf680f2e1dc70e7ebbf3a11e80c4e.png)

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [December 23, 2021, 4:02pm UTC](https://forum.knime.com/t/process-string-transformation-and-math-formula/38364/4 "2021-12-23T16:02:58Z")

</div>

@Kenyx I think it would help if you could provide us with a sample file and an explanation what you want to have as a result. You can identify blocks in an excel file hand handle them (eg. by giving the blocks IDs) as databases - like in this example:

> [@Loop on the basis of single Excel sheet data](https://forum.knime.com/t/loop-on-the-basis-of-single-excel-sheet-data/26510/7):
>
> OK it was slightly more complicated than I initially thought. But I hope it does work now: give each line a unique ID to identify them later identify the ‘heads’ of the tables (“FORMNAME”) like you already did use moving aggregate to give the heads unique numbers bring these numbers back to the data fill the intermediate (empty) cells with the head’s number use a group loop on the blocks identified by the head numbers extract the first line as column names make sure empty columns that would ju…

> **[kn\_forum\_26510\_excel\_single\_file\_loop – mlauber71](https://hub.knime.com/mlauber71/spaces/Public/forum/kn_forum_26510_excel_single_file_loop~3fQrmR608xaGA33J/current-state)**
>
> Extract a group of smaller tables (identifyed by a keyword) from Excel file with some empty columns and store them in separate new Excel files - give each line…

But you will have to invest some thoughts in the structure and what parts of you data would be dynamic.

But maybe your solution is much simple you might just have to assign rules to a data table.

---

<div class="post-metadata">

**Author:** ![Kenyx](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/7ba0ec/32.png) [@Kenyx](https://forum.knime.com/u/Kenyx)\
**Post date:** [December 24, 2021, 1:27am UTC](https://forum.knime.com/t/process-string-transformation-and-math-formula/38364/5 "2021-12-24T01:27:18Z")

</div>

> [@mlauber71](#):
>
> I think it would help if you could provide us with a sample file and an explanation what you want to have as a result. You can identify blocks in an excel file hand handle them (eg. by giving the blocks IDs) as databases - like in this example:

> [@mlauber71](#):
>
> But you will have to invest some thoughts in the structure and what parts of you data would be dynamic.
> 
> But maybe your solution is much simple you might just have to assign rules to a data table.

@mlauber71  
Yes, as I was continue the previous work of previous intern, he analyzed dataset’s original parameter result by a metanode which consists 20 rule engine, each engine processes parameter with each tolerance by ‘within’ and ‘out of range’. Currently, I want to optimize the workflow and analyze more focusing on the effect of the outlier value of the preceding parameter on the subsequent parameter.  
I will try your recommendation workflow today. Thanks.

---

<div class="post-metadata">

**Author:** ![gonhaddock](https://forum-cdn.knime.com/user_avatar/forum.knime.com/gonhaddock/32/35425_2.png) [@gonhaddock](https://forum.knime.com/u/gonhaddock)\
**Post date:** [December 24, 2021, 2:04pm UTC](https://forum.knime.com/t/process-string-transformation-and-math-formula/38364/6 "2021-12-24T14:04:11Z")

</div>

Hi @Kenyx  
I am getting a closer picture on your challenge. @mlauber71 is giving you some tips for gathering and cleaning up your data.  
I’m sharing a workflow for prepared for a different post on past October. I think that it can be useful for your challenge as it covers some of the bullets that you mention:

- Iterate over groups of data
- Individual math or statistical analysis (bounds and binning) by groups.

> **[EDA \_ Statistic Supported Binning By Groups – gonhaddock](https://hub.knime.com/gonhaddock/spaces/Public/latest/EDA%20_%20Statistic%20Supported%20Binning%20By%20Groups~fJATk_lfE0rMi3PG)**
>
> Workflow created for the KNIME forum ... https://forum.knime.com/t/contar-valores/36860 DESCRIPTION: The challenge is to bin the results of a questionary, by s…

BR

---

<div class="post-metadata">

**Author:** ![Kenyx](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/7ba0ec/32.png) [@Kenyx](https://forum.knime.com/u/Kenyx)\
**Post date:** [December 24, 2021, 3:35pm UTC](https://forum.knime.com/t/process-string-transformation-and-math-formula/38364/7 "2021-12-24T15:35:31Z")

</div>

Thank you @gonhaddock  
Definitely iteration and group process will be best solution of large amount of parameter, but currently I haven’t totally understand flow variable, different kinds of loops usage and application yet. I will try out during weekend.  
Merry Christmas~  
Best regard,  
Ken

---

<div class="post-metadata">

**Author:** ![Geo](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/g/f4b2a3/32.png) [@Geo](https://forum.knime.com/u/Geo)\
**Post date:** [December 25, 2021, 10:19am UTC](https://forum.knime.com/t/process-string-transformation-and-math-formula/38364/8 "2021-12-25T10:19:32Z")

</div>

you should unpivot the data, then process your variable(s) in long format, and finally pivot to get it back to wide format

---

<div class="post-metadata">

**Author:** ![Kenyx](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/7ba0ec/32.png) [@Kenyx](https://forum.knime.com/u/Kenyx)\
**Post date:** [December 25, 2021, 12:14pm UTC](https://forum.knime.com/t/process-string-transformation-and-math-formula/38364/9 "2021-12-25T12:14:23Z")

</div>

> [@Geo](#):
>
> unpivot the data, then process your variable(s) in long format, and finally pivot to get it back to wide format

@Geo  
Agree, I had the same idea at first too, change the wide format into long format. But the flow variable, loops and iteration trapped me, I have no idea about those configs and formation set up. 🤨  
Otherwise, there will be one rule for one parameter, that will be same huge workload.

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [January 6, 2022, 1:50am UTC](https://forum.knime.com/t/process-string-transformation-and-math-formula/38364/10 "2022-01-06T01:50:37Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
