Filter data from formula in a text field
- 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
I am trying to store a formula as a string in a text field in my dataset, and then filter the same dataset by referencing the field in which the formula is stored in the custom filter expression field. For example, the string stored in the data field [formula] will be:
"[field1] > 10 OR [field2] > 10"
and the custom filter expression will simply be:
[formula]
Is there any way to make this work?
Solved! Go to Solution.
- Labels:
- Dynamic Processing
- Optimization
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Currently, try the dynamic replace. Here's a KB article. If you post some sample data, I'd be glad to help further if you get stuck.
I find the dynamic replace confusing and not very straightforward. You may wish to star my idea which is to have alteryx add an eval function so that your formula would be eval([formula]) and it would then work as you're expecting. https://community.alteryx.com/t5/Alteryx-Product-Ideas/Add-function-quot-eval-quot/idi-p/42900 This sort of functionality exists elsewhere (Access, R, etc.).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Patrick,
I actually managed to do it with a really simple batch macro: Use a control parameter to update the expression value in the filter to the equation I want. The macro returns an error in the design window because it doesn't recognize the 'formula' variable in the custom filter expression, but when you replace it with string-formula I built, it works like a charm.
Thanks for your reply! I'll look into using the dynamic replace another time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@dakeefe Good to hear! I love batch macros and use them all the time.