Copying formulas from one formula tool to the other
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello! hoping someone might have a way around this. I have a set of formulas done in one Formula tool to add in new columns.
Now I need to replicate all these formulas to existing formula tools in my workflow. What would be the best way for doing this?
- Labels:
- Best Practices
- Tips and Tricks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You could copy the Formula tool, delete the other Formula tools, then paste the one you copied to replace those you deleted. If you're really ambitious, you could open your workflow in Notepad++, search for the formulas you want to add to the other Formula tools, copy and paste them under those tools and save. Next time you open your workflow, your Formula tools will have the formula(s) you copied from the one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Please expand by citing examples and screenshots.
Thanks,
Kamen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Here's the before shot, where I have two expression in my original Formula tool and two test Formula tools with just text in them.
After I saved, right-click on the file and click on "Edit with Notepad++". Click on Ctrl-F then click on "Find All in Current Document," so you can search for the word "formula" wherever it exists in the file.
This is what I found:
What I was looking for was the formula I wanted to copy. This is it:
So I copied and pasted the two middle lines to replace "<FormulaField expression="'Test1'" field="Test1 Formula Tool" size="1073741823" type="V_WString" />" and "<FormulaField expression="'Test2'" field="Test2 Formula Tool" size="1073741823" type="V_WString" />" then saved it with a new version number and with the file extension .yxmd.
When I opened the new file in Designer, I can then see my original Formula tool unchanged and now my two others have the formulas I copied and pasted into them from Notepad++.
**Be careful, though. Don't overwrite the original file in case you make a mistake.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Here's the before, where I have my original Formula tool with two expressions in it and two other formulas tools with just text in them -- Test1 and Test2.
I saved it and then went to the file location in my folder and right-clicked it. Then I selected "Edit with Notepad++." Once I had it open I clicked on Ctrl-F to bring up the Find window. I entered the word "formula" in the search bar and clicked on "Find All in Current Document."
Notepad++ opens up a window at the bottom with my search results.
What I was looking for was this:
 
These are the two expressions I want to keep and copy to my other Formula tools.
<FormulaField expression="DateTimeAdd([Qtr End Date],1,'days')" field="First of Month" size="10" type="Date" />
<FormulaField expression="DateTimeAdd(DateTimeAdd([First of Month], -3, 'months'),-1,'days')" field="Last Qtr End Date" size="10" type="Date" />
Then I pasted it to replace <FormulaField expression="'Test1'" field="Test1 Formula Tool" size="1073741823" type="V_WString" />. And then pasted it again to replace <FormulaField expression="'Test2'" field="Test2 Formula Tool" size="1073741823" type="V_WString" />.
Then I saved the file with a different version number so I didn't overwrite my original file.
As you can see, both new Formula tools have both expressions in them now.
 
This may be the long way, though. You could just update the XML in the workflow: https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Copying-of-formulas/td-p/91541....
