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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
M1ha
Contributor
Contributor

Load column with a different name and a condition

I have the column 'Category' and I would want to load a different column with the fields from 'Category' having a different name. Something like in the table below:

Thank you!

Category

Group

A

A as X

B

B as X

C

C as Y

D

D as Y

E

E as Z

F

F as Z

 

 

 

Labels (1)
1 Reply
MatheusC
Specialist II
Specialist II

Maybe this: Inline mapping,

MapChange:
Mapping
load * Inline [
From, To
A,X
B,X
C,Y
D,Y
E,Z
F,Z
];

to your to/from In your table with the Appalymap() function, mapping your category values.

load

ApplyMap('MapChange',Category,Category) as Group
....
From[...];

*In this example, whatever is not found in the mapping returns the Category value, you can adjust if you do not want this return*

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

- Regards, Matheus

 

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!