Alteryx Designer Desktop Discussions

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

Positive and negative month sequence based on date column and indicator column

PB41091
7 - Meteor

Hi,

I have below data set. I want to create 3 output columns considering the conditions explained as follows.

1. if A is same, then based on Date and Column C, if column B is changed according to C column ( from N to Y) considering successive month-year, then create output columns as shown below.

Input:

 

ABDateC
abcq11/30/2021N
abcq12/31/2021N
abcq1/31/2022N
abcq2/28/2022N
abcm3/31/2022Y
lmnj8/31/2020N
lmnj9/30/2020N
lmns12/31/2020N
lmns1/31/2021N
lmns2/28/2021N
lmns3/31/2021N
lmns4/30/2021N
lmns5/31/2021N
lmng6/30/2021Y
lmng7/31/2021Y
lmng8/31/2021Y
pvre1/31/2021N
pvre2/28/2021N
pvrt11/30/2021N
pvrt12/31/2021N
pvrt1/31/2022N
pvro3/31/2021Y

 

Output: (Conversion flag_o1), O2, O3

 

ABDateCCoversion flag_O1O2O3
abcq11/30/2021N  -4
abcq12/31/2021N  -3
abcq1/31/2022N  -2
abcq2/28/2022N  -1
abcm3/31/2022Y100
lmnj8/31/2020N   
lmnj9/30/2020N   
lmns12/31/2020N  -6
lmns1/31/2021N  -5
lmns2/28/2021N  -4
lmns3/31/2021N  -3
lmns4/30/2021N  -2
lmns5/31/2021N  -1
lmng6/30/2021Y100
lmng7/31/2021Y 11
lmng8/31/2021Y 22
pvre1/31/2021N  -2
pvre2/28/2021N  -1
pvrt11/30/2021N   
pvrt12/31/2021N   
pvrt1/31/2022N   
pvro3/31/2021Y100
4 REPLIES 4
SPetrie
12 - Quasar

Im not entirely sure what your criteria are when evaluating what to change/create.

For example, why does PVR/t have nothing in the new columns but PVR/e does?

You should be able to create these rows using some multi-row tools. You just need to better define what triggers the new values.

I can replicate the first 2 new columns, but again, I dont know if I am actually understanding what your rules should be.

SPetrie_0-1651502504348.png

 

PB41091
7 - Meteor

Hi SPetrie, 

 

Thanks for your revert.

To clarify your doubt : "For example, why does PVR/t have nothing in the new columns but PVR/e does?"

 

Column O3 is dependent on column B, date and column C.

 

PVR/t , just observe dates.

pvr/o is "Y' in column C. So consider the date 3/31/21. . Last entry for pvr/t is on 1/31/22 with Column C as N. 

Date for pvr/o is not the successive month for last entry of pvr/t.

If we consider pvr/e, the last entry is on 2/28/21 with column C as "N". therefore if we consider pvr/o with 'Y' along with date 3.31/21 as conversion point, then the occurrence of  pvr/e is going to be negative series.

 

Same case for rest of the values in B column considering A column

PB41091
7 - Meteor

Hi,

 

Will you be able to display 2nd MultiRow formula completely?

SPetrie
12 - Quasar

Here is the workflow I came up with.

If I understand the rules correctly, this should work. 

Even if I am wrong, this should get you going.

SPetrie_0-1651510864041.png

 

Labels