Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
LesJean
Contributor III
Contributor III

Problem using renamed fields to calculate a new field

Hello everyone,

First of all, the script below works fine and does exactly what I want.

Avec @.png

The problem I envision comes from the fact that I'll eventually have other .csv files which have a column named "@22". Thus, I wanted to use the new name I gave to the column, which would be "tblCommande_StPst", to work around this eventual problem. The script below shows this implementation.

sans @.png

But, this script returns an error when I try to compile it.

load.png

Now, to get to my question, I'm wondering if there is a way to use the renamed field name in a calculation. Because the error seems to tell me that Qlik Sense can't find the field "@22" with its new name.

Any help would be greatly appreciated.

Thank you for your time,

LesJean

1 Solution

Accepted Solutions
marcus_sommer

It's in general not possible to reference to a field which didn't exists in the source and is just created within the current load. Either you keep by your first approach or you might use a preceeding load, which means:

load *, a + b as c;
load @1 as a, @2 as b from Source;

- Marcus

View solution in original post

2 Replies
marcus_sommer

It's in general not possible to reference to a field which didn't exists in the source and is just created within the current load. Either you keep by your first approach or you might use a preceeding load, which means:

load *, a + b as c;
load @1 as a, @2 as b from Source;

- Marcus

LesJean
Contributor III
Contributor III
Author

Thank you for your answer Marcus, I did manage to make it work with a preceding load!