Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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])
)
I don't think this can be converted to a pick match statement....
Maybe you can use a pick/ match combination here, but I believe without any benefit.
Pick( Match( getselectedcount([Year]) &'-'& getselectedcount([Month Year]), '0-0'),
...
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
Pradosh
Yes, like pradosh suggested, you should use a +1 to account for a default value and change the order of expressions accordingly.
But still, I believe this won't perform better nor be better maintainable than the original If().