4 Replies Latest reply: Oct 9, 2017 9:31 AM by Stefan Wühl

# Convert if statement to pick - match function

How to convert the below if statement to pick - match combination:

If(getselectedcount([Year])<1 and getselectedcount([Month Year])<1

,

Sum({\$<[Month Year]=,[Year]=,[MonthID]= {"\$(=((Year(Today()) -1)*12) + Num(Month(Today())))"}>} [Target])

,

Sum([Target])

)

• ###### Re: Convert if statement to pick - match function

I don't think this can be converted to a pick match statement....

• ###### Re: Convert if statement to pick - match function

Maybe you can use a pick/ match combination here, but I believe without any benefit.

Pick( Match( getselectedcount([Year]) &'-'& getselectedcount([Month Year]), '0-0'),

...

• ###### Re: Convert if statement to pick - match function

Try this

pick(match(getselectedcount([Year])&getselectedcount([Month Year]) ,'00')+1, Sum([Target]),Sum({\$<[Month Year]=,[Year]=,[MonthID]= {"\$(=((Year(Today()) -1)*12) + Num(Month(Today())))"}>} [Target])

regards