Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
asantos
Contributor III
Contributor III

How to load field names based on the content of another field?

Hello,

I'm currently trying to have it load the fields according to the values of another field, so that I don't have to wrap it in too many if statements.

I've tried it with mapping + AppplyMap and assign it to a variable, but it gives me an error, saying Blank Field Names are not allowed.

Mapping
FieldTable:
Load 
Description,
FieldName
From [lib://Repositorio Custos/GR/DREFormatting.xlsx]
(ooxml, embedded labels, table is FieldNamesDisc.);
NewTable:

Load
	chave2,
    ApplyMap('FieldName', [Description]) as '$(vFieldName)' ,

I thought it'd be through a for loop, but I can't figure out how to set it.

 

Thanks in advance.

Labels (2)
3 Replies
MayilVahanan

Hi @asantos 

 Instead of above, try with below.

ApplyMap('FieldTable', [Description]) as '$(vFieldName)

We need to use "MappingTableName" in ApplyMap function.

More details, please refer

https://help.qlik.com/en-US/sense/September2020/Subsystems/Hub/Content/Sense_Hub/Scripting/MappingFu...

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
asantos
Contributor III
Contributor III
Author

Hi, @MayilVahanan !

The error still remains. I've tried it wit a static name instead of a variable and it ran ok. The problem seems to be on the variable name itself.

MayilVahanan

Hi @asantos 

You want to assign the values then use apply map..

If you want to rename the field name, then use rename function. Refer the below thread.

https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/Scripting/Scrip...

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.