Alteryx Designer Desktop Discussions

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

Multi row formula increment by grouping

QurrathAmeena
8 - Asteroid

 

Hi all,

 

For the following sample data I'm trying to perform following operations:

 

1.Group the data on basis of col1 ,col 4 and col2 and the second part of OP is updated and incremented accordingly.

2. Group the data on basis of col1 , col3 ,col5 and the first part of OP is updated and incremented accordingly

col1col2col3col4col5op
BottleAS06-07-201609-06-2018S1||A1
BottleAS06-07-201609-06-2019S1||A2
BottleAS08-09-201818-05-2020S2||A1
CupQA12-15-201101-11-2014A1||Q1
CupQA12-15-201101-11-2015A1||Q2
CupRA12-9-201508-07-2011A1||R1

 

When I tried it with multi-row formula its treating each row as a new case and incrementing it accordingly, so despite my best efforts, I have been unable to complete the first part of the OP using the sample data provided above.

 

Could anybody help me resolve the issue ?

Thanks in advance 

10 REPLIES 10
FinnCharlton
13 - Pulsar

One method is to use the tile tool. This works well for generating the second part of the "op". However I'm unsure how you are planning to generate the first part of the "op", as all of your values in column 5 are unique. Grouping by this column won't aggregate the data.

FinnCharlton_0-1673616739077.png

 

QurrathAmeena
8 - Asteroid

Actually I'm trying to get the op column as a whole ! I was stuck at on how to update the part 1 of OP  that's what I meant .

 

FinnCharlton
13 - Pulsar

@QurrathAmeena What is the logic that tells you where the first part of OP should be incremented? You say it is based on grouping on columns 1,3 and 5, but as column 5 has only unique values this will not aggregate the data.

 

The first part of OP seems to increment between rows 2 and 3, why is this? There is no set of values unique to just these two rows.

QurrathAmeena
8 - Asteroid

This just a sample set of my original data . In the actual data there are instances where col 5 has duplicate values and in those cases it has to be treated separately.

 

Let me explain in detail what I'm trying to do and achieve with this data: 

 

1. For the second part of OP -- firstly ,  if they belong to same category in Col1 

                                              -- secondly ,  if the belong to same type in Col 2

                                             -- lastly ,  if they belong to same date in Col 4 

Ex: In case of Bottle category  we see there are 3 different values belonging to same category but the date(col 4) for row 3 is different and hence the counter restarts  in row 3

 

For the first part of OP -- firstly , if they belong to same category in Col1 

                                    --secondly ,  if they belong to same type in Col 3

                                   -- lastly,if they are have same date in col 5

Input :

 

col1col2col3col4col5
BottleAS06-07-201609-06-2018
BottleAS06-07-201609-06-2019
BottleAS08-09-201818-05-2020
CupQA12-15-201101-11-2014
CupQA12-15-201101-11-2015
CupRA12-9-201508-07-2011

 

Output:

 

col1col2col3col4col5op
BottleAS06-07-201609-06-2018S1||A1
BottleAS06-07-201609-06-2019S1||A2
BottleAS08-09-201818-05-2020S2||A1
CupQA12-15-201101-11-2014A1||Q1
CupQA12-15-201101-11-2015A1||Q2
CupRA12-9-201508-07-2011A2||R1

 

 

 

FinnCharlton
13 - Pulsar

Column 5 is different between rows 2 and 3, so would this not restart the counter for the first part of OP?

QurrathAmeena
8 - Asteroid

The first part of OP is grouped based on col4 and second part of OP is grouped based on col 5

FinnCharlton
13 - Pulsar

But column 4 is also different between rows 2 and 3? Just a bit confused why the first part of OP increments between these rows

QurrathAmeena
8 - Asteroid

For the first 2 rows col 1-4 has same values right ? that's why the first part of OP is same and the second part is incremented

 

DataNath
17 - Castor

Hey @QurrathAmeena, is this what you're after?

 

DataNath_0-1673620564379.png

 

Labels