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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Extract first word from query

If i want to pull just the first word (can be of nay length) from a query, what string function can i use?

for ex: select name from... or create table ... or drop table..

so i want to display the first word in a column..from the query column.. how can i do it?

1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

I`m not sure if I understood it.

Do you want to get the first word of a field in a table?

You can try this:

Load subfield( name,' ',1) as firstWord;

select name from ...

The subfield function will segment the string on field name when it finds a space (' ') then, it will return  only the first subfield (1 as the last parameter).

Hope I got it right,

Erich

View solution in original post

2 Replies
erichshiino
Partner - Master
Partner - Master

I`m not sure if I understood it.

Do you want to get the first word of a field in a table?

You can try this:

Load subfield( name,' ',1) as firstWord;

select name from ...

The subfield function will segment the string on field name when it finds a space (' ') then, it will return  only the first subfield (1 as the last parameter).

Hope I got it right,

Erich

IAMDV
Master II
Master II

I agree with Erich! Need more explanation if SubField is not what you need. Please explain in detail to get expected answers.

Thanks - DV