Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Conditional Join for Input files

JCornacchia
6 - Meteoroid

I have 2 input files that are rather large. The 1st file contains 2019 data and the other contains data for 2020-2021. I have the user inputting what time frame they are looking for but that is done as a filter after the join between the 2 files occur. My question is if I can put in a condition that if the user is only looking at 2020 dates, is there a way for the input file/join to ignore the 2019 file? Since these are large files, it takes a little bit for the workflow to complete so my thought was that if the 2019 file wasn't needed, that would speed up the process.

8 REPLIES 8
mceleavey
17 - Castor
17 - Castor

Hi @JCornacchia ,

 

Yes, you can use the interface tools to populate the selection if you don't want them opening the workflow, however you can continue with the filter if that's good enough for what you want.

 

We can build this for you if you post some mock data and your workflow.

 

M.



Bulien

JCornacchia
6 - Meteoroid

Attached is an example of the beginning portion of my workflow. So the user inputs the start/end dates and I would like the condition to be if 2019 in either of the inputs, then complete the union, if not just use the 2020_2021 input file. I am using the filter now but these files are large so if there's a way that this would speed up the workflow, that would be ideal.

mceleavey
17 - Castor
17 - Castor

Hi @JCornacchia ,

 

In the real workflow are you using the Directory tool to determine which input files are available? 

The reason I ask is because this won't be dynamic with hardcoded files.

 

M.



Bulien

JCornacchia
6 - Meteoroid

No, I have the 2 files hardcoded. I know the directory tool exists but I'm not familiar with how to use it

atcodedog05
22 - Nova
22 - Nova

Hi @JCornacchia 

 

I think i understood your ask. Here is what you can do.

 

Workflow:

atcodedog05_3-1622046969392.png

 

You can place a filter for 2019 data before its unioned. And filter can check whether either of the text inputs conations 2019 if yes pass through the data if not pass no rows(refer above highlighted where 0 rows are passed) and its not unioned

 

Output:

atcodedog05_0-1622047291738.png

 

Hope this helps 🙂

JCornacchia
6 - Meteoroid

That's a good idea but the workflow would still bring in that 2019 file which is what takes so long so I was hoping to get a filter prior to Alteryx even pulling in the file.


I came up with a possible solution where I put an action item with a formula from the start date. So if it contains 2019, then bring in the 2019 file otherwise I created a dummy file that has no information so it doesn't take long for the workflow to bring in the file (I also did the same thing for the 2020_2021 file in the real workflow). I'm not sure that's the best solution but it works.

JCornacchia_0-1622060494628.pngJCornacchia_1-1622060508001.png

 

atcodedog05
22 - Nova
22 - Nova

Hi @JCornacchia 

 

Since now i have a better idea of what you are looking for that you do not want read 2019 if its not selected. Here is what you can do.

 

workflow:

atcodedog05_0-1622093572250.png

 

1. You can add 2019 input tool to a container.

2. Using condition tool i am pluging-in in values from start date & end date and checking them. If neither of them contains 2019 i am collapsing the container (i,e input tool wont run). If either of them have 2019 it will stay active and run.

 

Hope this helps 🙂 

JCornacchia
6 - Meteoroid

That works great and is easier than creating a dummy file. Thank you!

Labels