Jump to content


Photo

Question:Data Wizard ,replace

Data Wizard replace

  • Please log in to reply
3 replies to this topic

#1 0521

0521

    Advanced Member

  • Members
  • PipPipPip
  • 46 posts

Posted 16 May 2017 - 02:52 AM

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

Attached Thumbnails

  • 报错提示.jpg

Attached Files


Edited by 0521, 16 May 2017 - 03:03 AM.


#2 Simon Davis

Simon Davis

    Advanced Member

  • Administrators
  • 1,318 posts

Posted 16 May 2017 - 10:04 AM

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.

Attached Files



#3 mittyright

mittyright

    Advanced Member

  • Members
  • PipPipPip
  • 98 posts

Posted 17 May 2017 - 04:36 PM

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

Attached Files



#4 0521

0521

    Advanced Member

  • Members
  • PipPipPip
  • 46 posts

Posted 05 June 2017 - 03:25 PM

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






Also tagged with one or more of these keywords: Data Wizard, replace

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users