Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Sorting Sheet Names

KamenRider
11 - Bolide

HI,

 

I would like to sort the sheet tabs by adding letter before the filename. Can someone help me correct the formula i made? or any ideas to formulate a solution? Example A. Summary  B. Ana Perez

 

IIF([RecordID] = 1, "A. ",
IIF([RecordID] = 2, "B. ",
IIF([RecordID] = 3, "C. ",
IIF([RecordID] = 4, "D. ",
IIF([RecordID] = 5, "E. ",
IIF([RecordID] = 6, "F. ",
IIF([RecordID] = 7, "G. ",
IIF([RecordID] = 8, "H. ",
IIF([RecordID] = 9, "I. ",
IIF([RecordID] = 10, "J. ",
IIF([RecordID] = 11, "K. ",
IIF([RecordID] = 12, "L. ",
IIF([RecordID] = 13, "M. ",
IIF([RecordID] = 14, "N. ",
IIF([RecordID] = 15, "O. ",
IIF([RecordID] = 16, "P. ",
IIF([RecordID] = 17, "Q. ",
IIF([RecordID] = 18, "R. ",
IIF([RecordID] = 19, "S. ",
IIF([RecordID] = 20, "T. ",
IIF([RecordID] = 21, "U. ",
IIF([RecordID] = 22, "V. ",
IIF([RecordID] = 23, "W. ",
IIF([RecordID] = 24, "X. ",
IIF([RecordID] = 25, "Y. ",
IIF([RecordID] = 26, "Z. ",
"ZZ. "))))))))))))))))))))))))))) + [Sheetname]

 

I am having a parse error.

 

Thanks.

4 REPLIES 4
apathetichell
19 - Altair

If this is under 26 sheets -> CharFromInt([RecordID+64) --- if it's potentially greater than 26 you have to do some floor division and stuff ot get it in to the AA format...

 

and this gets you to 700 sheets or something ---> if floor([RowCount]/26)=0 then CharFromInt(65+mod([RowCount],26)) else
charfromint((floor([RowCount]/26)+64))+CharFromInt(65+mod([RowCount],26)) endif

KamenRider
11 - Bolide

HI @apathetichell 

 

Tries this formula using the formula tool but it gave me error - "Parse error at char(45): unknown function "Chr" (Expression #1)

 

IF Floor(([RecordID] - 1) / 26) = 0 THEN
Chr(65 + Mod([RecordID] - 1, 26))
ELSE
Chr(64 + Floor(([RecordID] - 1) / 26)) + Chr(65 + Mod([RecordID] - 1, 26))
ENDIF

 

Please advise.

 

Kamen

binuacs
21 - Polaris

@KamenRider The formula provided by @apathetichell  is correct, you need to use CharFromInt instead of Chr in your formula

image.png

apathetichell
19 - Altair

@KamenRider --- hey can you accept my dope solution to your problem?

Labels
Top Solution Authors