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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
pascos88
Creator II
Creator II

ApplyMap with SubField

Hello,

It is possible to use ApplyMap and inside Sub field?

I need somethings like this

MAP_TURBINE:

Mapping load * inline [

Turbine, NormTurb

WTG01, E1

WTG02, E2

WTG03, E3

WTG04, E4

WTG05, E5

WTG06, E6

];

ApplyMap('MAP_TURBINE', SubField(FileBaseName(),'_',4) then NormTurb, SubField(FileBaseName(),'_',4)  as Turbine;

I know that the script is wrong, but I want if SubField(FileBaseName(),'_',4) = WTG01 or WTG02 ... or WTG06 so I need to rename in NormTurb.


Thanks for any help

Pasquale

Labels (1)
2 Replies
marcus_sommer
MVP
MVP

Maybe in this way:

ApplyMap('MAP_TURBINE',

     if(match(SubField(FileBaseName(),'_',4), WTG01, WTG02, ..., WTG06),           NormTurb, SubField(FileBaseName(),'_',4)), 'ApplyMapDefaultValueForNotFound')  as Turbine;

- Marcus

ysj
Creator
Creator