2 points by s40racer 9 months | flag | 1 comment

Hello,

I have an implementation to display supplier data (quantity, $ amount, etc) by year.


sum(PO.LokadNetAmount) when (isoyear(PO.Date) == isoyear(DV.today)) as "Net Amount 2022" {unit: #(UoM.currency)}

The DV.today seem to have a hard-coded value of 2022. My data has 2023 YTD information. Is there a way to change the code to read the 2023 information?

DV.today does not appear anywhere before this line, so it is not hard-coded before this line.

Please let me know if more information is needed.

Thank you.

vermorel 9 months | flag

Envision has a today() function, see


show scalar "Today" a1b2 with today()

table X = with 
  [| today() as today |]

show table "X" a3b4 with X.today

See https://try.lokad.com/s/today-sample

In your example above, DV.today is not hard-coded but most likely loaded from the data. It's a regular variable, not the standard function today().

Hope it helps,
Joannes