InseeFr / Trevas

Transformation engine and validator for statistics.
MIT License
10 stars 5 forks source link

Invalid type for numerics #298

Closed romaintailhurat closed 1 month ago

romaintailhurat commented 9 months ago

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' ```
NicoLaval commented 9 months ago

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

NicoLaval commented 8 months ago

@romaintailhurat any news?

romaintailhurat commented 8 months ago

Checking with the Post Processing team at Insee

NicoLaval commented 1 month ago

@romaintailhurat can we close?

romaintailhurat commented 1 month ago

Probably