Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is it possible to dynamically read the value of a variable:
load if(year(referentie_datum) = 2018,
$(v_kosten_laden_lossen_18),
$(v_kosten_laden_lossen_19)
)
as var_value
I want to get rid of the year clause. Something like:
$(v_kosten_laden_lossen_& right(year(referentie_datum,2))
It's just an example and you could simply extend the mapping-table to all years/values you need.
- Marcus
I think I wouldn't use multiple variables for such a case else just a mapping like:
map: mapping load * inline [
Jahr, Wert
2018, 1
2019, 2];
and then:
load *, applymap('map', year(referentie_datum), 'any default value') as var_value
...
- Marcus
Hi Marcus,
thanks for helping, but I have more than one 1 variable:
Var1 ---- value 2018 ---- value 2019
Var2 ---- value 2018 ---- value 2019
etc
Next year, there will be value 2020
It's just an example and you could simply extend the mapping-table to all years/values you need.
- Marcus