Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
fzalexanderjohn
Creator
Creator

Compare variable to result of addyears() in load script

Hello,

I have these two lines in my load script:

 

    if([Datum ab] <= date('$(vDatenStand)') and [Datum bis] >= date('$(vDatenStand)'), Betrag) as 'Betrag aktuell',
    if([Datum ab] <= date(addyears('$(vDatenStand))',-1)) and [Datum bis] >= date(addyears('$(vDatenStand))',-1)), Betrag) as 'Betrag VJ',

The first one works as intended, the second one doesnt.

The variable:

Let vDatenStand = today()-1;

How the data in the fields looks:

2019-01-30 08_25_49-Vertriebsdaten GL 6.1 _ Datenmodell - Qlik Sense.png

I tried it without the date() function as well. But I can't get it to work

 

Labels (1)
1 Reply
fzalexanderjohn
Creator
Creator
Author

I noticed the wrong ')' at (vDatenStand)) like 10 seconds after posting.. not enough coffee