Let function: error msg: "List usage is not allowed in this calculation"

Question asked by bungknot on Jun 13, 2018
Latest reply on Dec 1, 2018 by bungknot

Hi everyone and thanks for looking at this when/if you do!

I'm just grappling with learning the Let function having not used it previously - possibly a bit of a mind block!

However, I can grasp it now but when I tried it on this particular test example I got the above error so wonder where I am going wrong?

I did look at someone else's question on here but it didn't solve my particular problem so I thought it best to post my own example:

So, the calc field results in a text output and it's just to try out the Let function based on which month (by number) we are in which shows if we are in a 31 day month. It's just a test - please understand that - it's being used to try the principle.

-----------------------------------------------------------------------------------

Let

(

[1=31; 2=28; 3 =30; 4=30; 5=31; 6=30; 7=31;8=31; 9=30; 10=31; 11=30; 12=31;]; end=""

)

//calculation using the above Let function//

Case (

Month ( Get ( CurrentDate ) ) =1 ; "You are in a month with 31 days"

; Month ( Get ( CurrentDate ) ) =5 ; "You are in a month with 31 days"

; Month ( Get ( CurrentDate ) ) =7 ; "You are in a month with 31 days"

; Month ( Get ( CurrentDate ) ) =8 ; "You are in a month with 31 days"

; Month ( Get ( CurrentDate ) ) =10 ; "You are in a month with 31 days"

; Month ( Get ( CurrentDate ) ) =12 ; "You are in a month with 31 days"

; Month ( Get ( CurrentDate ) )≠ 1 ; "You are not in a month with 31 days" ;

; Month ( Get ( CurrentDate ) ) ≠5 ; "You are not in a month with 31 days"

; Month ( Get ( CurrentDate ) ) ≠7 ; "You are not in a month with 31 days"

; Month ( Get ( CurrentDate ) ) ≠8 ; "You are not in a month with 31 days"

; Month ( Get ( CurrentDate ) ) ≠10 ; "You are not in a month with 31 days"

; Month ( Get ( CurrentDate ) ) ≠12 ; "You are not in a month with 31 days"

""

)

//Results in the text "You are in a month with 31 days" if the month is 1, 5, 7, 8 10 or 12//

-----------------------------------------------------------------------------------