Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Dynamic solution to filter data on basis of multiple conditions and get multiple outputs

Radhika
6 - Meteoroid

Hi All,

Can anyone help me with this scenario?

I have one input as a database, below is its format. I have some filter conditions to get data.

I need to create multiple flows in one canvas based on filter conditions and get multiple outputs.

Each condition can vary on different columns of input with 'and' and 'or' conditions and in the output, I need 3 columns - Eid (from input ), Category, Code (created in the canvas based on conditions defined),

Required: I need to create an optimized alteryx solution where I can have all the columns of the input and every time a new condition is given, I just need to add 'AND' and 'OR' conditions to those particular columns mentioned in the condition and generates a new output of 3 columns (Eid, Category, Code)  in the same canvas in which Category and code are generated during the flow as per the condition. Hardcode values will be given for Category and Code in every defined condition. 

 

Example : 

Input sample

EidProcess_dateDeptAssigned_teamLocationSal_currencyBase_locationUnitManager_NameDays
120-07-2022AAAZCADZZavhjAB1
221-07-2022BBBYINRYYyahjVBF2
322-07-2022BCCXJPYTTavhHG3
423-07-2022DDDWUSDWWkgsSJ4
5 24-07-2022EEEVCADVVnjhAJ5

 

Let's say I have condition 1 for 1st flow -

Dept =A and sal= CAD then category = 'def' and code ='11'

Output - Output should be

EidCategorycode
1def11

 

Condition 2 :

Dept=B and (assigned_team = bb or cc) and (unit = YY or TT) then category = 'GHI' and code ='22'

the output should be ;

EidCategorycode
2GHI22
3GHI22

 

Condition may use any string functions on any column.

Here I have given two conditions only but there'll be around 100 so I need an optimised and automated data driven solution for this so that every time a condition is given, I have to just add 'AND' and 'OR' conditions to the particular columns and less of manual work.

If anyone can help, Thanks in advance.

14 REPLIES 14
Radhika
6 - Meteoroid

@FilipR do you have any alternate solution bcz even if I am creating it from scratch with the same inputs and everything same, as used by you it's not giving me results, there are no output records. I am new to alteryx. I have checked all the configurations with the one you have created and using the same inputs but no output. So if you have any alternative or any setting which I should be aware of or if you can elaborate it and check if you provided the correct workflow and macro.

FilipR
11 - Bolide

@Radhika  Try putting your real data into the Text Input tool it in the workflow I attached. See if it works. Then check the conditions you are putting in the other tool.

 

Since my example works, your real data should work as well, unless you're doing something wrong somewhere along the way.

ChrisTX
16 - Nebula
16 - Nebula

@Radhika trying to test/debug a macro, especially as a beginner, can be challenging.

 

These two options are helpful to debug macros:

 

1) Designer > View > Interface Designer > Test View (the magic wand icon on the left hand side) > input your values > Open Debug.
This will create a new standard workflow with the actual values coming from your inputs.
A copy of the workflow will open called Debug Workflow# (# being some number)
You can use the Debug mode to test what values are passed from the app interface to the workflow
https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Random-results-while-renaming-fields/t...

 

  • To use the debug feature, open the Interface Designer (Views > Interface Designer) and select the Test View (the Magic Wand icon on the left). Fill out the information requested by your app or macro, then click on Open Debug. A debug workflow will open as a new tab in your current Alteryx session. Run the debug workflow to make sure it is creating your desired results.

 

2) Community > Blogs > Engine Works Blog > The X-Ray Browse: Macro Debugging Made Easier
Designed primarily for developing & debugging macros, the X-Ray Browse enables you to pick a location within a macro under development, to view the data passing through said macro at said location. The effect is similar to a Browse tool, but the data is made viewable through the encapsulating "skin" of the macro being developed.
https://community.alteryx.com/t5/Engine-Works-Blog/The-X-Ray-Browse-Macro-Debugging-Made-Easier/ba-p...
Gallery Download link for X-Ray Browse Macro: https://gallery.alteryx.com/#!app/X-Ray-Browse-Macro/546263f9398a7111307b0cdc

 

 

Also try: workflow configuration option (checkbox) for "Show All Macro Messages"

 

Also see:

Debugging Alteryx Analytic Apps

https://www.altertricks.com/how-to/debugging-alteryx-analytic-apps/

 

Chris

Arvinchester
6 - Meteoroid

Hi FilipR,

 

Do you have the macro file that you used here?

FilipR
11 - Bolide

@Arvinchester it should be inside the yxzp I posted.

Labels
Top Solution Authors