Just getting started on AppSheet and landed a...

Just getting started on AppSheet and landed a issue that should have an answer.

I have a simple form where I want to capture the pay period (that has ENUM values for each month - Jan, Feb, โ€ฆ Dec).

Now I want the field to have a default value corresponding to the current month.

So if the form is entered on 5/1/2018, the payPeriod field should default to โ€œMayโ€.

When the entry is made on 4/30/2018, the payPeriod field should default to โ€œAprโ€.

I tried using TEXT(MONTH(), โ€œMmmโ€) which is the Google Spreadsheet function.

Didnt work in AppSheet.

I tried using SWITCH(MONTH(), โ€œJanโ€, โ€œFebโ€,โ€ฆ โ€œDecโ€) that didnt work

Any suggestions?

0 6 358
6 REPLIES 6

Correct format isโ€ฆ SWITCH(MONTH([DateColumn]), 1,โ€œJanโ€, 2,โ€œFebโ€, โ€ฆ 11,โ€œNovโ€, โ€œDecโ€)

In the initial value property try Month(Today()) Which will give you the month as a number by default. To give it to you in โ€œMmmโ€ format you might have to do a nested IF statement.

A combination of both your responses worked.

Here is the solution:

=SWITCH(MONTH(TODAY()), 1, โ€œJanโ€, 2, โ€œFebโ€, 3, โ€œMarโ€, 4, โ€œAprโ€, 5, โ€œMayโ€, 6, โ€œJunโ€, 7, โ€œJulโ€, 8, โ€œAugโ€, 9, โ€œSepโ€, 10, โ€œOctโ€, 11, โ€œNovโ€, โ€œDecโ€)

Thanks.

Cool! I now know about SWITCH expressions. Thanks @Padman_Kondur and

@Aleksi_Alkio.

El problema con esta expresiรณn es que cuando ordenas por meses, lo hace empezando por abril y no por enero Translate

Seems there are many bugs.

At least one i can identify is with SWITCH.

Doesnโ€™t look like it can take more than 5 values.

The following works if I have months up to โ€œMayโ€.

As soon I add โ€œJunโ€, it gives error.

Top Labels in this Space