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: 
Not applicable

Dynamic 'as' in Load

Hi!

I'm using Section Access and I would like to be able to dynamically change the "as ..." part depending on if the user has the three first digits in Access set to 'LFC' or not.

LOAD
    
Trim(ROLL) as ROLL,
    
USER,
    
if((match(mid(Access,1,3),'LFC')),Access as [Fomr(T)],Access as Kluster)

FROM

Is this even possible?

Regards Johan

2 Replies
Anonymous
Not applicable
Author

Johan,

You can use this:

LOAD
     Trim(ROLL) as ROLL,
     USER,
     Access as [Fomr(T)]
FROM...
WHERE match(mid(Access,1,3),'LFC')

CONCATENATE LOAD
     Trim(ROLL) as ROLL,
     USER,
     Access as Kluster
FROM...
WHERE match(mid(Access,1,3),'LFC')=0

Regards,
Michael

marcus_sommer

Generally you could a field named with a variable dynamically, but it meant always only one field at the time and not two fields. I think you should rather create two separate fields and react later in your script/expressions appropriate.

- Marcus