Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Not able to get previous year data correctly with reference to current year

somuayoddhya
5 - Atom

I want previous year sales data,
Need to match the current date with previous year date and get sales data for the previous date.
I have tried using join and union tools,
initially joining the previous year transaction date with current year transactiondate and trying to get the prev year net sales, but values are not accurate.

i am getting null for previous year sales

 

Current Year DatePrevious Year DateCurrent Year Sales Previous Year Sales
21-12-202120-12-2020166668888Null
8 REPLIES 8
atcodedog05
22 - Nova
22 - Nova

Hi @somuayoddhya 


Can you provide some sample input (which has both current year and previous year data) and expected output It will help us get a better understanding of the usecase.

We will be happy to help : )

Qiu
20 - Arcturus
20 - Arcturus

@somuayoddhya 
If I understand you correctly.

Since you want the date to be matched, so lets remove the year.

Capture6A.PNGCapture6B.PNG

AbhilashR
15 - Aurora
15 - Aurora

Hi @somuayoddhya, assuming your data is structured in a manner where current and prev year values are part of the same column attribute, you can create a new date column and subtract one year from each date, and join it back to itself to get current and prev yr values. Attached is a proof of concept of what that might look like

 

AbhilashR_0-1641012259224.png

 

Hope this helps!

atcodedog05
22 - Nova
22 - Nova

Hi @somuayoddhya 

 

My approach is similar to @AbhilashR I am using find and replace tool instead of join tool to include row entries even if they don't have the previous year.

 

Workflow:

atcodedog05_0-1641025331883.png

 

Happy to help : )

Happy new year to you and your close ones : ) May it be filled with happiness and prosperity =D @AbhilashR and @somuayoddhya 

somuayoddhya
5 - Atom

Thanks for all the response friends,

Please find below, 

the input i have and expected output,

 

somuayoddhya
5 - Atom

Thanks for all the response friends,

Please find below, the input i have and expected output i want,

i am not able to get the expected output,  Please help.

somuayoddhya
5 - Atom

Adding to the below, please find my sample work flow.

I am supposed to group by ID column to get both Value and Right Value in same row.

But the values should not be summed if i use group by, please help.

somuayoddhya_0-1641132639879.png

 

 

atcodedog05
22 - Nova
22 - Nova

Hi @somuayoddhya 

 

Here is how you can do it.

Workflow:

atcodedog05_0-1641205929362.png

 

Hope this helps : )

 

Labels