Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
agbcn
Contributor III
Contributor III

ApplyMap question

Hi,

 

I just created a new field in one of my tables as a result of an ApplyMap():

ApplyMap('Company_Country', IdCompany) as IdCountry which works OK. As a result, I get a new column in my table named IdCountry which keeps the country of the company.

When I try to use that new field in an ApplyMap() (for instance to get the continent), an error shows up claiming IdCountry is not found:

ApplyMap('Company_Continent',IdCountry ) as IdContinent,
ApplyMap('Company_Continent_Name',IdCountry) as ContinentName,

One workaround could be the following:

ApplyMap('Company_Continent', ApplyMap('Company_Country', IdCompany)) as IdContinent,
ApplyMap('Company_Continent_Name', ApplyMap('Company_Country', IdCompany)) as ContinentName,

What am I doing wrong?

 

Thanks for your help

Àlex

1 Solution

Accepted Solutions
sunny_talwar

Are you doing this in the same load? or is this in a load statement (resident or precedent load) after idCountry has been created? The same load doesn't work, because the field is still getting created and you cannot refer to the field being created in the same load (at least not for this scenario).

View solution in original post

4 Replies
sunny_talwar

Are you doing this in the same load? or is this in a load statement (resident or precedent load) after idCountry has been created? The same load doesn't work, because the field is still getting created and you cannot refer to the field being created in the same load (at least not for this scenario).

agbcn
Contributor III
Contributor III
Author

Hi @sunny_talwar 

Thanks for your quick reply!

I'm doing this in the same table load, so I guess I should use a temporary table instead.

Regards,

àlex

sunny_talwar

You can use a temporary table or you can use Preceding LOAD 

agbcn
Contributor III
Contributor III
Author

Thanks! I'm gonna try Preceding Load