Forum Discussion
Potential bug with date() ?
- 2 years ago
I have the weirdest fix for this ... switch back the regional settings in PBI to the default.
A little annoying, but trying to figure out and fix what PBI messes up in the background is way worse.
Hi zahlenschubser ,
Be carefull that the SWITCH function is done based on the order of the several rows so if the first one is getting a true value the statetment stops, in this case not sure what is group 6 you refer but please check the order of your switch statement because it can be based on that.
The conditions being triggered one after another is fine, as I tried to make them specific for each customer group.
What I intended to do is have switch() evaluate a combination of the customer group code and the current month and then determine when the group will next be up for billing.
For example
, rechnungsgruppe[rechnungsgruppe_pk] IN {43 , 45 , 48} && MTH in {1,2,3}, DATE(YR , 3 , 1)
supposedly means that if the group is 43 or 45 or 48 AND the current month is Jan/Feb/Mar > output March of the current year as next billing.
I tried to streamline and reorder the code a bit so I don't have multiple lines trigger the same date, but I'm still getting the same error. =(