Bedrijf does not exist in the data returned from your SQL SELECT statement, so you cannot use it here.
I am not sure of your data structure, but based on what you have posted I suggest the following.
- Remove the where-if line from the second LOAD. I suspect that this statement would not be doing what you are expecting anyway, but you cant use Bedrijf here.
- Add this line to the first LOAD (where Bedrijf does exist:
If(Bedrijf = 'VIT', 'GRV', 'GRS') As RSKD06
Hope that helps
I tried your solution but it doesn't do what I expect it to do.
When the company is 'VIT', then the field RSKD06 is GRV.
For the other companies, the field RSKD06 is blank. I would expect to see GRS there.
If I can get this working, I can make a key field to make the join with the REKF06 table.
What have I done wrong?
Here the adjusted code:
[Amount Transaction Curr],
[Amount EUR Curr],
If(Bedrijf = 'VIT', 'GRV', 'GRS') as RSKD06