Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

mario-sarkis
Contributor II

Sperate an single field

Hello

if have a field look like this

1|caca|as

123|asd|r

1234|ssdsd|2

i need to separeta this example

first field           secondField    third Field

1                        caca                 as

123                    asd|                  r

1234                  ssdsd              2

Hope you can help thanks


8 Replies
mario-sarkis
Contributor II

Re: Sperate an single field

or it is enough to extract the first field and rest still concatenate

Thanks

arulsettu
Honored Contributor III

Re: Sperate an single field

try this

SubField('1|caca|as','|',1) as field1,

SubField('1|caca|as','|',2) as field2

SubField('1|caca|as','|',3) as field3

sasiparupudi1
Honored Contributor III

Re: Sperate an single field

SubField('1|caca|as','|',1)  as Firstfield

SubField('1|caca|as','|',2)  as Secondfield

SubField('1|caca|as','|',3)  as Thirdfield

Re: Sperate an single field

SubField(YourField,'|'1) as field1,

SubField(YourField,'|',2) as field2

SubField(YourField,'|',3) as field3

mario-sarkis
Contributor II

Re: Sperate an single field

hi KUSH

if my fied looks exactly like this :

42216|Services|Dial Up Internet

42216|Services|Domiciliations

42216|Services|Pin Pay

42216|Services|Safe Box

42216|Services|Sweep

42248|Accounts|403

42248|Accounts|421

42248|Accounts|427

42248|Accounts|461

42248|Accounts|462

I don't want to seperate but only want to replace '42248' by '42247'

Hope you can help

sasiparupudi1
Honored Contributor III

Re: Sperate an single field

something like this?

if( substringCount(YourField,'|')>1 and SubField(YourField,'|',1)=42248,replace(YourField,4248,4247),YourField))

Re: Sperate an single field

You can do something like this

if(SubField(Field,'|' ,1)='42248', Replace(Field,SubField(Field,'|' ,1),'42247'),Field)  as Field1

But where you want to show this value ? In Field 1 or Filed 2 or field3?

qlikmsg4u
Valued Contributor

Re: Sperate an single field

Load *,Replace(Test,42248|,42247|) as Test1;

Load * Inline [

Test

42216|Services|Dial Up Internet

42216|Services|Domiciliations

42216|Services|Pin Pay

42216|Services|Safe Box

42216|Services|Sweep

42248|Accounts|403

42248|Accounts|421

42248|Accounts|427

42248|Accounts|461

42248|Accounts|462

];