Question:Data Wizard ,replace

Dear Supporter:

I want to change “1_25h" in "” to “1.25”, but I failed.

  1. I use the “Data Wizard”–“Filter”–“Replace”, and I find that this can only replace all the contents of the cell, but not part of it.

  2. So I switched to other tools, I use the “Data Wizard”–“Transformation”–“Custom”,

2.1 replace(Parameter,1,1,“”) ,replace first “_” to “”

2.2 if(search(Parameter1,““,1)>0,Parameter1,replace(Parameter1,search(Parameter1,””,1),1,“.”), replace Second “_” to “.” ,this step was failed.

"


Execution Error

There was an error while executing Workflow.Data Wizard
起始索引不能小于 0 或大于输入长度。
参数名: startat

OK

"

2.3 I think it may be my formula input too long, so I then separate the formula into a multi-step, but still the same error hint.

I do not know how to solve, so I want you help.

​0521
Test.phxproj (257 KB)

Hi 0521, sorry I’m not in front of my v7 machine now but will try and look at your project later. In the meantime I quickly mocked up a couple of alternative steps that might be useful in the attached v6.4 project.

First step gets rid of leading undescore and trailing h.

second uses the replace option to insert the decimal point.

mid(timetext,2,(length(timetext)-2))

replace(time1,2,1,“.”)

sometimes the DW gets a little unhappy if the lenght of the text string is differing and some steps ask for locations longer than the shortest text string.

you get a message like;

'There was an error while executing Workflow.Data Wizard 1

Index was outside the bounds of the array.’

For this reason I try to break things down into a couple of steps so I can minimise these problems.

Simon.

_1_25h_v64.phxproj (109 KB)

Hey there,

here’s my version (I assumed 0 was mistakenly added in Stack column)

Be aware of using mid() and replace() inside of conditions!

The parser does not like it in case of incorrect results for any of true/false! Same thing in PHX6.4/7.0

I cross my fingers will be fixed in next version

TestMittyright.phxproj (478 KB)

Thank you so much! :slight_smile: But it’s a little difficult to operate. :blink: