Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
kulasekhar
Creator
Creator

Divide groups

Hi Guys,

using this i want to filter data :

condition1)   if two '_' (Underscore's) are there , i want middle value

condition 2)  if one '_' score there i want first value before underscore

condition 3) if there is no underscore i want the same value as it is,

all three conditions should be for that field ,, save result in new field.


GROUPNAME

EGR_EGTS_BATCH

IPG_PMRD_ADM

IPG_PMDE_ADM

GIT_OVSC_ADM

GIT_OVSC_BATCH

ITIO_ITR_BATCH

Srinivas_Vandrasi

EGIT_EGSD_BATCH

EGIT_PRAO_BATCH

EGIT_EGSD_ADM

PPS_PCSC_ADM

GREP_HRPY_ADM

GREP_HRPY_BATCH

ITIO_ITR_BATCH

IPG_USAG_ADM

BASL_ADM

EGIT_PRAO_ADM

ITIO_ITR_ADM

GIT_MDM_UPU

EDS_SXD_ADM

GIT_EDW_BATCH

IPG_LOT_BATCH

Administrator

GIT_MDM_ADM

PPS_PCSC_BATCH

Thanks,

sekhar.

3 Replies
sushil353
Master II
Master II

Hi,

Try below code:

test:
LOAD *, if(len(SubField(GROUPNAME,'_',SubStringCount(GROUPNAME,'_')))=0,GROUPNAME,SubField(GROUPNAME,'_',SubStringCount(GROUPNAME,'_'))) as test Inline
[
GROUPNAME

EGR_EGTS_BATCH

IPG_PMRD_ADM

IPG_PMDE_ADM

GIT_OVSC_ADM

GIT_OVSC_BATCH

ITIO_ITR_BATCH

Srinivas_Vandrasi

EGIT_EGSD_BATCH

EGIT_PRAO_BATCH

EGIT_EGSD_ADM

PPS_PCSC_ADM

GREP_HRPY_ADM

GREP_HRPY_BATCH

ITIO_ITR_BATCH

IPG_USAG_ADM

BASL_ADM

EGIT_PRAO_ADM

ITIO_ITR_ADM

GIT_MDM_UPU

EDS_SXD_ADM

GIT_EDW_BATCH

IPG_LOT_BATCH

Administrator

GIT_MDM_ADM

PPS_PCSC_BATCH
]
;

HTH

sushil

kulasekhar
Creator
Creator
Author

Thanku,

Sushil.

anbu1984
Master III
Master III

Load *,SubField(GROUPNAME,'_',Rangemax(SubStringCount(GROUPNAME,'_'),1)) Inline [

GROUPNAME

EGR_EGTS_BATCH

Srinivas_Vandrasi

Administrator ];