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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Field values need to separate

Hi All,

Could you please help me to separate the below field values .

Example data:

 

PA_1:1305.0
PA_2:1311.0
PA_3:1306.0
PA:0.0
recDate=}
recDate=2016-11-1519:19:22.010}
recDate=2016-11-1519:19:22.110}
recDate=2016-11-1519:19:22.210}
recDate=2016-11-1519:19:22.310}

Output should be as like below

1305.0
1311.0
1306.0
0.0
}
2016-11-1519:19:22.010
2016-11-1519:19:22.110
2016-11-1519:19:22.210
2016-11-1519:19:22.310
1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Data:

Load

  YourFieldName as OriginalFieldName,

  IF(SubStringCount(YourFieldName,'='),

     PurgeChar(SubField(YourFieldName,'=',-1),'}'),

     SubField(YourFieldName,':',-1)) as YourNewFieldName2

Inline

[

  YourFieldName

  PA_1:1305.0

  PA_2:1311.0

  PA_3:1306.0

  PA:0.0

  elapsedTime=27710

  recDate=}

  recDate=2016-11-1519:19:22.010}

  recDate=2016-11-1519:19:22.110}

  recDate=2016-11-1519:19:22.210}

  recDate=2016-11-1519:19:22.310}

];

View solution in original post

8 Replies
MK_QSL
MVP
MVP

Data:

Load

  YourFieldName as OriginalFieldName,

IF(SubStringCount(YourFieldName,'recDate='), Replace(SubField(YourFieldName,'recDate=',-1),'}',''), SubField(YourFieldName,':',-1)) as NewFieldName

Inline

[

  YourFieldName

  PA_1:1305.0

  PA_2:1311.0

  PA_3:1306.0

  PA:0.0

  recDate=}

  recDate=2016-11-1519:19:22.010}

  recDate=2016-11-1519:19:22.110}

  recDate=2016-11-1519:19:22.210}

  recDate=2016-11-1519:19:22.310}

];

surendraj
Specialist
Specialist

Hi Venkatesh,

For first 4 fields

you can apply

SubField('PA_1:1305.0',':',2)

For 5th field

subfield('recDate=}','=',2)

For last 4 fields

trim(replace(subfield('recDate=2016-11-1519:19:22.010}','=',2),'}',' '))


Based on your requirement you can use the sub field function,to extract set of field value by using delimiter separater.

Hope this may help you!!

--Surendra

Not applicable
Author

Hi Manish,

Thanks for the replay ,

i got it but i have one more value including above mentioned which is like this

elapsedTime=27710

how to get the value like this "27710" ?

However the output values are coming like string in list box ?

Not applicable
Author

Hi Surendra,

Tanks for the reply but i should get all the values into same field .

MK_QSL
MVP
MVP

Data:

Load

  YourFieldName as OriginalFieldName,

  IF(SubStringCount(YourFieldName,'='),

     PurgeChar(SubField(YourFieldName,'=',-1),'}'),

     SubField(YourFieldName,':',-1)) as YourNewFieldName2

Inline

[

  YourFieldName

  PA_1:1305.0

  PA_2:1311.0

  PA_3:1306.0

  PA:0.0

  elapsedTime=27710

  recDate=}

  recDate=2016-11-1519:19:22.010}

  recDate=2016-11-1519:19:22.110}

  recDate=2016-11-1519:19:22.210}

  recDate=2016-11-1519:19:22.310}

];

Not applicable
Author

Hi Manish,

Thank you so much it is working perfectly however data was showing like text in list box (left side ) 

list.PNG

will it possible to get into right side ?

surendraj
Specialist
Specialist

Properties-->Presentation-->alignment-->(enable right)..

MK_QSL
MVP
MVP

Data:

Load

  YourFieldName as OriginalFieldName,

  IF(SubStringCount(YourFieldName,'recDate='),Replace(SubField(YourFieldName,'recDate=',-1),'}',''),SubField(YourFieldName,':',-1)) as NewFieldName,

  IF(SubStringCount(YourFieldName,'='),

  Alt(

  TimeStamp#(PurgeChar(SubField(YourFieldName,'=',-1),'}'),'YYYY-MM-DDhh:mm:ss.fff'),

  Num(PurgeChar(SubField(YourFieldName,'=',-1),'}'))

  ),

  SubField(YourFieldName,':',-1)) as YourNewFieldName2

Inline

[

  YourFieldName

  PA_1:1305.0

  PA_2:1311.0

  PA_3:1306.0

  PA:0.0

  elapsedTime=27710

  recDate=}

  recDate=2016-11-1519:19:22.010}

  recDate=2016-11-1519:19:22.110}

  recDate=2016-11-1519:19:22.210}

  recDate=2016-11-1519:19:22.310}

];