We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

How to find SUM - Group by Year

Pandey19
8 - Asteroid

Hi,

 

I've my input like below

 

MAR YTD BALJUN YTD BALSEP YTD BALDEC YTD BALOUTPUT CYCLE/YEAR
$0$0$0$0F2021
$79,771,846.14$67,724,757.77$58,196,009.18$48,970,909.29F2021
$0$0$0$1.61F2021
$0$0$0$0F2021
$11,807,123,617.58$10,068,028,616.10$9,501,283,617.15$217,261,759.51F2021
$7,011,296,443.35$6,880,874,855.43$3,082,921,837.10$4,475,362,432.55F2021
$115,461,052.75$201,793,414.47$0$0F2020
$0$0$86,051,617.81$72,066,713.67F2020
$0$0$5$0F2020
$0$0$0$0F2020
$28,348,054,921.96$31,308,011,333.22$23,834,680,627.26$13,747,234,028.70F2020
$18,540,348,421.84$14,905,906,255.67$8,253,115,703.08$9,584,090,945.10F2020

 

And i'm running my workflow every qyarter and i want to find SUM value based on logic.

If i'm running for Q1 then it should calculate SUM(MAR) for only current year and SUM(DEC) for last year.

For Q2, it should take SUM(JUN) and SUM(MAR) of same year.. Likewise for all quarters.

 

SO my output should look like  below-

MAR YTD BALDEC YTD BAL
$0$0
$79,771,846.14$72,066,713.67
$0$0
$0$0
$11,807,123,617.58$13,747,234,028.70
$7,011,296,443.35$9,584,090,945.10

 

$18,898,191,907$23,403,391,687

 

How to achieve this? I just 

1 REPLY 1
RolandSchubert
16 - Nebula
16 - Nebula

Hi @Pandey19 ,

 

an approach would be to create a kind of "matchcode" for quarter/previous quarter and year/year for previous quarter. A Join tool can be used to select the respective quarters.

 

2022-03-11_13-57-27.jpg

 

I used a Text Input to to select the current quarter/year and, this could also be calculated based on current date or selected using interface tools.

 

What do you think?

 

Best,

 

Roland 

Labels
Top Solution Authors