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

how to get Output based on Filter condition

Karthick461
8 - Asteroid

HI,

 

 I am using 2 files. one is past years data and another one is current month data. If the month is Jan means, output should come as last year(2021) ( jan to dec ) data has to come .. or else for any other month current month data should come.

 

Any idea how to achieve this

 

 

12 REPLIES 12
csmith11
11 - Bolide

Not sure I understood the question. 

 

Here's an example of how you might export to different Sheets in the same excel file base on a particular field value.

 

csmith11_0-1641997321805.png

 

Karthick461
8 - Asteroid

I will explain my issue or question.

 

I have total 2 input source. and one output source. all are csv formats

 

One input source has historical data. like 2010 to 2021 and other input has current month data.

 

I need to have one filter condition that will give output in same source(same sheet) based on filter condition

 

Filter condition is, if month is JAN , output has to show last year complete records from Jan to Dec or else for any month current month data should be there in output

atcodedog05
22 - Nova
22 - Nova

Hi @Karthick461 

 

Here is how you can do it. Filtering is dynamic based on current month data. Let me know If this works.

Workflow:

atcodedog05_0-1642000408738.png

 

Hope this helps : )

Karthick461
8 - Asteroid

Thanks for the WF @atcodedog05 

 

You have taken current month data as 01/01/2022 . So the month is Jan. That is my actual input.

 

But I am getting output as 2022 Jan and previous year data(2021) in output . But my actual requirement is If my current input month is Jan, I need only last year data. not current month ( Jan ) data. 

Once I get Feb 2022 in my current month , I need to show only feb 2022 output , not previous year data.

 

Any help on that please

 

Karthick461_0-1642004077379.png

 

atcodedog05
22 - Nova
22 - Nova

Hi @Karthick461 

 


But I am getting output as 2022 Jan and previous year data(2021) in output . But my actual requirement is If my current input month is Jan, I need only last year data. not current month ( Jan ) data. 

This point is implemented in the new workflow.

 


Once I get Feb 2022 in my current month , I need to show only feb 2022 output , not previous year data.

This I didn't understand.

 

Hope this helps : )

Karthick461
8 - Asteroid

Hi @atcodedog05 ,

 

 My First Requirement is perfectly working for Jan Month.

 My 2nd and last requirement is for other months except Jan.

 In your Workflow , I have changed the current month as Feb 2021 . Updated historical data last date as 12/31/2020 for testing.

Karthick461_0-1642005453967.png

 

 But I am getting again 2020 records as output. Actually I need output as 2021 Feb month

 

Karthick461_1-1642005596022.png

 

For Jan alone, I need previous year data. Other all months current year data is required.

 

Sorry to bother you a lot.

 

 

 

atcodedog05
22 - Nova
22 - Nova

Hi @Karthick461 

 

Here is the updated workflow. I am guessing one more correction is required please check and let me know.

 

Hope this helps : )

gabrielvilella
14 - Magnetar

Hi @Karthick461, here is my take on this. I made two scenarios within the same workflow, the filter condition is the same on both, just the starting data that is different. 

Karthick461
8 - Asteroid

Still Other Month Issue is there @atcodedog05 .

 

Attached the WF. choosed 2021-03-01 and [Date] <= "2021-03-31" as Current Month . When i run the flow, Output is 0.

Since this month is March, I need to show output as March dates alone. like 2021-03-01 to 2021-03-01.

 

If I choose Jan month as current data, it is perfectly working . Shows entire last year data

 

Issue is with Other Months only

Labels