Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Kalyani22
Contributor II
Contributor II

How to replace short cut name (HYD) with Full name Hyderabad.

Hi,

I have a field called Emp name and the data in Emp name ABharthy, VVenkatesh, KEshetti , SBandla like this.

Now I want to expand the Name Aswini Bharathi , Vigneshwar venkatesh.

I have the list of Full names in Inline load.

Load

Empid,

Emp name,

Department,

salary,

Address,

Date

From qvd(qvd);

Load*Inline

[

Emp_full_name

Aswini Bharathi ,

Vigneshwar venkatesh,

Kalyani Erramshetti,

Sujitha Bandala

];

How can i replace this Full name from Inline load with E

Labels (1)
3 Replies
ali_hijazi
Partner - Master II
Partner - Master II


whenever a column name / alias has space then you need to put the column name inside double quotation or square bracket

 

load Emp_full_name as [Emp Name]

or 

load Emp_full_name as "Emp Name"

I can walk on water when it freezes
Sayed_Mannan
Creator II
Creator II

Hi,

To replace the short names with full names, you can use a mapping load. Here's how you can do it:

// Load your main data

EmpData:
Load
Empid,
Emp name,
Department,
salary,
Address,
Date
From qvd(qvd);

// Load your full names

FullNames:
Mapping Load*Inline
[
Emp_short_name, Emp_full_name
ABharthy, Aswini Bharathi,
VVenkatesh, Vigneshwar venkatesh,
KEshetti, Kalyani Erramshetti,
SBandla, Sujitha Bandala
];

// Use the ApplyMap function to replace the short names with full names

EmpData:
Load
Empid,
ApplyMap('FullNames', [Emp name], [Emp name]) as [Emp name],
Department,
salary,
Address,
Date
Resident EmpData;

Drop Table EmpData;

In this script, `ApplyMap` function is used to replace the short names with full names. If a match is not found in the mapping table, it will keep the original value. Please replace `Emp_short_name` and `Emp_full_name` with your actual column names.

I hope this helps! If you have any further questions, feel free to ask. If this resolve your query then don't forget to mark this as a solution.

TauseefKhan
Creator III
Creator III

Hi @Kalyani22,
To match the full names with the abbreviated names in Qlik, I have used a combination of string manipulation functions and a mapping load.

Output:

TauseefKhan_0-1716344037799.png

 

Script:

Full_Names:
LOAD * INLINE [
Emp_full_name
Aswini Bharathi,
Vigneshwar Venkatesh,
Kalyani Erramshetti,
Sujitha Bandala
];

Temp_Abbrev_Names:
LOAD
Left(Emp_full_name, 1) & Mid(Emp_full_name, Index(Emp_full_name, ' ') + 1, 1)
& Mid(Emp_full_name, Index(Emp_full_name, ' ') + 2,2)
as Abbrev_Name,
Emp_full_name
RESIDENT Full_Names;

Map_Emp_Name:
Mapping Load
Abbrev_Name,
Emp_full_name
Resident Temp_Abbrev_Names;

Drop Table Full_Names , Temp_Abbrev_Names;

// Main data table

Table_2:
load *,
ApplyMap('Map_Emp_Name',Abbrev_Name,Emp_name) as Emp_full_name;

Table_1:
load
Empid,
Emp_name,
Department,
Left(Emp_name, 1)
& Mid(Emp_name, Index(Emp_name, ' ') + 2,1)
& Mid(Emp_name, Index(Emp_name, ' ') + 3,2)
as Abbrev_Name,

salary
Inline [
Empid, Emp_name, Department, salary
1, ABharthy, YE, 550
2, VVenkatesh, TV, 250
3, KEshetti, HP, 203 ] ;

** When applicable please mark the correct/appropriate replies as "solution". Please LIKE threads if the provided solution is helpful to. **