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.
SOLVED

How to assign a string based on a condition from two column dates ?

NaveenB
6 - Meteoroid

Hi 

 

Need your help to assign the expiry periods ( E1 or E2 or E3) based on date & expiry date ...In the below, if you notice each date has different expiry dates so I would like assign the nearest expiry date as E1, next closest as E2 and so on...while assigning the data the grouping is based on asset and the nearest expiry date is based on date.

 

hope my question is clear and I have provided the expected output as well.

I would really appreciate your support.

 

AssetValueDateExpiry DateOutput
Bank24510/23/202010/29/2020E1
Bank24610/23/202011/26/2020E2
Bank24510/23/202012/31/2020E3
Non-Bank119.510/23/202010/29/2020E1
Non-Bank119.510/23/202011/26/2020E2
Bank24610/22/202010/29/2020E1
Bank24610/22/202011/26/2020E2
Bank24610/22/202012/31/2020E3
Non-Bank11910/22/202010/29/2020E1
Non-Bank11910/22/202011/26/2020E2
Bank24710/21/202010/29/2020E1
Bank24710/21/202011/26/2020E2
Bank2159/30/202010/29/2020E1
Bank2159/30/202011/26/2020E2
Bank2159/30/202012/31/2020E3
Non-Bank112.59/30/202010/29/2020E1
Non-Bank1139/30/202011/26/2020E2
Non-Bank1139/30/202012/31/2020E3
Bank2159/29/202010/29/2020E1
Bank2159/29/202011/26/2020E2
Bank2159/29/202012/31/2020E3
Non-Bank112.59/29/202010/29/2020E1
Non-Bank112.59/29/202011/26/2020E2
Non-Bank112.59/29/202012/31/2020E3
Bank2179/28/202010/29/2020E1
Bank2189/28/202011/26/2020E2
Bank2189/28/202012/31/2020E3
Non-Bank112.59/28/202010/29/2020E1
Non-Bank112.59/28/202011/26/2020E2
Non-Bank112.59/28/202012/31/2020E3
Bank2109/25/202010/29/2020E1
Bank2109/25/202011/26/2020E2
Bank2109/25/202012/31/2020E3
Non-Bank110.59/25/202010/29/2020E1
Non-Bank110.59/25/202011/26/2020E2
Non-Bank110.59/25/202012/31/2020E3
14 REPLIES 14
NaveenB
6 - Meteoroid

you are awesome...Thanks! 

NaveenB
6 - Meteoroid

small doubt, I could see a grouping option in Multi-Row-Field (select the field) then why to mention in the expression?

atcodedog05
22 - Nova
22 - Nova

@NaveenB 

 

Yup you have found it 🙂

What you are thinking is a better approach.

 

Configuration like below which is much more simpler and suggestable approach.

atcodedog05_2-1603615288938.png

 

Workflow:

atcodedog05_1-1603615091558.png

 

There is multiple ways how you can reach the same solution.

Its just people's style and preference on how they approach it. 

 

Hope this helps 🙂

NaveenB
6 - Meteoroid

Great..thank you again 🙂

atcodedog05
22 - Nova
22 - Nova

Happy to help 🙂 @NaveenB 

 

Cheers and Happy Analyzing 😀

Labels
Top Solution Authors