Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Multirow formula expression

SH_94
Bolide

Hi community,

 

I would like to ask how to create experession in the multi row formula tool  so that it can derive the result below

 
Input

Company Code Period
DK01                 KSL01
DK01                 KSL02
DK01                 KSL03
DK01                 KSL04
DK01                 KSL05
DK01                 KSLVT

 

 

Output

Company Code Period ID
DK01                 KSLVT 0
DK01                 KSL01 1
DK01                 KSL02 2
DK01                 KSL03 3
DK01                 KSL04 4
DK01                 KSL05 5

 

 

Appreciate the assistance and Thank you in advance

5 RÉPONSES 5
FrederikE
Pulsar

Hey @SH_94,

 

See the attached WF. 

KLSVT isn't the 0 here, please explain the logic why if it should be. It looks random to me. 

Unbenannt.png

FinnCharlton
Pulsar

Hi, @SH_94, it depends on what logic you want to use to sort and ID the data. Here I've sorted descending on the first 4 characters, then ascending on the number. This gets it in the right order for this example, but might not be what you want for the full data

Screenshot 2023-07-28 135435.png

SH_94
Bolide

Hi @FinnCharlton ,

 

I realise this approach had limitation as it will not able to function well if i have data below:

KSLVT

KSL01

KSL02

KSL03

KSL04

KSL05

KSL10

KSL22

 

Many thanks 

 

FinnCharlton
Pulsar

@SH_94 The logic for the ID field is still quite unclear. What would the expected output be for this dataset?

SH_94
Bolide

Hi @FinnCharlton 

 

Below contain input and output of the data

Input

Period

KSLVT

KSL01

KSL10

KSL02

KSL03

KSL05

KSL04

KSL22

 

Ouput

Period  ID

KSLVT   0

KSL01   1

KSL02   2

KSL03   3

KSL04   4

KSL05   5

KSL10   6

KSL22   7

 

Many thans again for the prompt response

Étiquettes