InseeFr/Trevas

Invalid type for numerics

Closed this issue · 5 comments

When handling expression like:

WEB := WEB [calc NHAB := if (nvl(NBHAB,0)=0) then 1 else cast(NBHAB,integer)];

in Kraftwerk, an error occurs:

invalid type Long, expected 0 to be Double

Note that this VTL expression is reused from the questionnaire definition (for which the used VTL implementation is TrevasJS)

The full error message in Kraftwerk
Script='WEB := WEB [calc NHAB := if (nvl(NBHAB,0)=0) then 1 else cast(NBHAB,integer)];'
Message='invalid type Long, expected 0 to be Double'

I reproduced your use case in tests and for me there is no error.
Is your Trevas version up-to-date?

Checking with the Post Processing team at Insee

@romaintailhurat can we close?

Probably