Help

Re: Stacked Switch Statement for Seasons

Solved
Jump to Solution
1404 0
cancel
Showing results for 
Search instead for 
Did you mean: 

Hello everyone,

Tinkering with my garden automations and I have seasons on my mind. There’s a couple of items I’m working on and thinking about, and figured I may as well post my questions here to help advance my Airtable skills.

Firstly, spending time with a Switch statement, is it possible to stack cases? For example;

SWITCH(Month{Date}
,1,"Summer"
,2,"Autumn"
,3,'Autumn'
,4,'Autumn'
,5,'Winter'
,6,'Winter'
,7,'Winter'
,8,'Spring'
,9,'Spring'
,10,'Spring'
,11,'Summer'
,12,'Summer')
SWITCH(Month{Date}
,[1,2,12],"Summer"
,[3,4,5],"Autumn"
,[6,7,8],'Winter'
,[9,10,11],'Spring')

And what are peoples thoughts on having rolling seasons within a recurring calendar? Not too sure about this one though, trying to map it out still, so perhaps it’s more of a base design question. :thinking:

DATETIME_PARSE(DATETIME_FORMAT({Recurring Date},'MM/DD')&"/"&YEAR(NOW()))
1 Solution

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto

No, it is not possible to stack cases as in your second example. Your first example should work fine.

See Solution in Thread

4 Replies 4
kuovonne
18 - Pluto
18 - Pluto

No, it is not possible to stack cases as in your second example. Your first example should work fine.

@Karlstens If @kuovonne provided the answer you were seeking, please mark her comment as the solution to your question. This helps others who may be searching with similar questions. Thanks!

Thanks Justin, if as a Community Leader, you have the ear of Airtable Devs, could you shuffle this to them for comment? Would make life easier if we could support a range within a Switch Statement. One day I’ll find to explore this further with an Automation script.

Unfortunately I don’t have the devs’ ears, at least not in a way that can influence any of their work. The “Community Leader” badge just means that a) I talk a lot, and b) some of it makes sense. :winking_face: