In an EnumList I always want to have two options:
If I hardcode it with the Base type “Number”, I get thousands separator.
I don’t like them, so I have to use Base type “Text”
Now it’s clear that I want to use an expression to calculate those two years.
So I tried this expression in the “Suggested_Values”:
LIST(
YEAR(TODAY()),
YEAR(TODAY())+1
)
But no matter if I use Base type Text or Number, I will get this Error:
Column Name ... has invalid 'Suggested Values' of '=LIST( YEAR(TODAY()), YEAR(TODAY())+1 )'. The type of the Suggested Values does not match the column type.
So the only way I could do this was:
LIST(
"20"&TEXT(TODAY(),"YY"),
"20"&(NUMBER(TEXT(TODAY(),"YY"))+1)
)
LIST(
TEXT(TODAY(),"YYYY"),
TEXT(TODAY()+365,"YYYY")
)
Because as soon as I use the full year and add 1 (2021+1) I will get thousands separator.
Does anyone have a smarter solution?
Solved! Go to Solution.
Your approach is a good one, though I might instead use:
LIST(
("" & YEAR(TODAY())),
("" & (YEAR(TODAY()) + 1))
)
Your approach is a good one, though I might instead use:
LIST(
("" & YEAR(TODAY())),
("" & (YEAR(TODAY()) + 1))
)
Awesome @Steve thank you very much!
User | Count |
---|---|
38 | |
35 | |
27 | |
23 | |
18 |