Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
rajneesh
Contributor II
Contributor II

How to extract middle of the filed data?

Hi Team,

In this below table middle of the field we have table name like HRPAL and CDDE.

id
adp_feedparser_EMP_TMF_COURSE_V1_DNH_1_1_HRPAL_20220712T104500
adp_feedparser_EMP_TMF_LRLRNGOFFPRGRS_V1_DNH_1_1_HRPAL_20220712T104500
adp_feedparser_EMP_TMF_COURSE_V1_DNH_1_1_HRPAL_20220714T090000
adp_feedparser_EMP_TMF_LRLRNGOFFPRGRS_V1_DNH_1_1_HRPAL_20220714T090000
adp_feedparser_ORBIT_EMP_CDDE_20220701T200000
adp_feedparser_ORBIT_EMP_CDDE_20220702T194500
adp_feedparser_ORBIT_EMP_CDDE_20220703T193000
adp_feedparser_ORBIT_EMP_CDDE_20220704T194500

 

I want create new field with only two words instead of entire column name.

 

Expected output:

ID

HRPAL

HRPAL

CDDE

CDDE

like that. Please help me on this.

 

Thanks

Raj

Labels (2)
1 Solution

Accepted Solutions
Taoufiq_Zarra

@rajneesh  many solutions, for example :

Data:

LOAD id,if(wildmatch(id,'*HRPAL*','*CDDE*')=1,'HRPAL','CODE') as newid INLINE [
    id
    adp_feedparser_EMP_TMF_COURSE_V1_DNH_1_1_HRPAL_20220712T104500
    adp_feedparser_EMP_TMF_LRLRNGOFFPRGRS_V1_DNH_1_1_HRPAL_20220712T104500
    adp_feedparser_EMP_TMF_COURSE_V1_DNH_1_1_HRPAL_20220714T090000
    adp_feedparser_EMP_TMF_LRLRNGOFFPRGRS_V1_DNH_1_1_HRPAL_20220714T090000
    adp_feedparser_ORBIT_EMP_CDDE_20220701T200000
    adp_feedparser_ORBIT_EMP_CDDE_20220702T194500
    adp_feedparser_ORBIT_EMP_CDDE_20220703T193000
    adp_feedparser_ORBIT_EMP_CDDE_20220704T194500
];

 

outpout:

Taoufiq_Zarra_0-1659085369669.png

 

 

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

1 Reply
Taoufiq_Zarra

@rajneesh  many solutions, for example :

Data:

LOAD id,if(wildmatch(id,'*HRPAL*','*CDDE*')=1,'HRPAL','CODE') as newid INLINE [
    id
    adp_feedparser_EMP_TMF_COURSE_V1_DNH_1_1_HRPAL_20220712T104500
    adp_feedparser_EMP_TMF_LRLRNGOFFPRGRS_V1_DNH_1_1_HRPAL_20220712T104500
    adp_feedparser_EMP_TMF_COURSE_V1_DNH_1_1_HRPAL_20220714T090000
    adp_feedparser_EMP_TMF_LRLRNGOFFPRGRS_V1_DNH_1_1_HRPAL_20220714T090000
    adp_feedparser_ORBIT_EMP_CDDE_20220701T200000
    adp_feedparser_ORBIT_EMP_CDDE_20220702T194500
    adp_feedparser_ORBIT_EMP_CDDE_20220703T193000
    adp_feedparser_ORBIT_EMP_CDDE_20220704T194500
];

 

outpout:

Taoufiq_Zarra_0-1659085369669.png

 

 

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉