Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good personal day!
I'm trying to perform a filter on my load, but without success ...
Come on,
I have a field that contains an "array" as making the timing of my service was online.
This is the structure of the field:
["07:20:00","07:30:00","07:40:00","07:50:00","08:00:00","08:10:00","08:20:00","08:30:00","08:40:00","08:50:00","09:00:00","09:10:00","09:20:00","09:30:00","09:40:00","09:50:00","13:40:00","13:50:00","14:00:00"] ["06:20:00","06:30:00","06:40:00","06:50:00","07:00:00","07:10:00","07:20:00","07:30:00","07:40:00","07:50:00","08:00:00","08:10:00","08:20:00","08:30:00","08:40:00","08:50:00","09:00:00","09:10:00","09:20:00","09:30:00","09:40:00","09:50:00","10:00:00","10:10:00","10:20:00","10:40:00","10:50:00","11:10:00","11:20:00","12:00:00","12:10:00","12:20:00","12:30:00","12:40:00","12:50:00","13:10:00","13:20:00","13:30:00","13:40:00","13:50:00","14:00:00"] ["09:30:00"] ["09:20:00","12:20:00","12:30:00","12:40:00","12:50:00","13:00:00","13:10:00","13:20:00","13:30:00"]
I need you in charge if there is a value "10:30:00" on the line he store that value in a new field, if there is no value in the field is null.
I managed to explain.
Thank you.
Hugs.
Hello Matheus,
You can try the function Index().
If(Index(Field,'10:30:00'),'10:30:00',Null()) AS NewField
Best Regards.
Tonial.
Hi Matheus,
you have to do that in several steps.
- First you have to use the SUBFIELD() function on that field to separate the entries of that array into one record per
entry.
=> Then you can search that table for a value '10:30:00' and if you find one, join that back to the original table.
HTH
Best regards,
DataNibbler
Hello Matheus,
You can try the function Index().
If(Index(Field,'10:30:00'),'10:30:00',Null()) AS NewField
Best Regards.
Tonial.
Hi,
one sciprt and front end representation could be:
tabTimeArray:
LOAD RecNo() as LineNo,
@1 as TimeArrayLine
FROM [http://community.qlik.com/thread/143867] (html, codepage is 1252, no labels, table is @1);
tabTimes:
LOAD LineNo,
SubField(PurgeChar(TimeArrayLine,'[]"'),',') as Time
Resident tabTimeArray;
hope this helps
regards
Marco