I didn't find the right place were to put the lines mentioned above, but I think I can help you anyway.
Mika Rinne-Kanto schrieb:
I load data from some of the "LaskutusSiirtoFakta.csv"-files
2.) Or the script don't give me any error messages and the new variables don't show up, when i put the script lines to the end of the script.
To point you into the right direction, lets have a look to the two script lines of your post:
In the first script line "if . . . as Var," this Var is quite another Var than in the following line "if. . . (1+Var)*peek(Index) . . .". As you can see in the original excel-file exists a column called Var. In the second line QV refers to that excel column, NOT to your Var in the line above. And because you do not have a (excel-)column called Var in your source-file you get the errror message "Field not found <Var>".
If you need the expression Var from the first line within the second line replace the Var in the second line with the whole calculation similar to this:
. . . (1+Var)*peek(Index) . . . -- >
. . . (1+([Laskutus kpl] - peek([Laskutus kpl]))/peek([Laskutus kpl])) * peek(Index) . . .
And first sorry for the late reply. Thanks for the helpful answer. Now I managed to get that Index variable show up. I only got it work when I put that line right after the LaskutusSiirtoFakta.csv -load statement (after the last variable [Laskutus kpl]). But no matter after which of the three LaskutusSiirtoFakta.csv -load statements I put it, it puts year 2011 as Index-base, so no year 2009 (?). And it only shows up Index value 100 and there's no movement in that variable in diffenent months. So I would like to get index value 100 to january 2009 for every product.
With best regards,