6 april 2023 Extracting text from strings with the SubField() function in Qlik Sense Deel dit bericht Every Friday at Bitmetric we’re posting a new Qlik certification practice question to our LinkedIn company page. Last Friday we asked the following Qlik Data Architect certification practice question about the SubField() function in Qlik Sense. The answers were unanimous: The correct answer is C The SubField() function returns the n-th field of a string based on a delimiter. Consider the following string: The quick brown fox jumps over the lazy dog This string contains multiple words, separated by spaces (the delimiter). Let’s load this string to a field called Sentence: Load * Inline [ Sentence The quick brown fox jumps over the lazy dog]; We can now return individual words from Sentence by using the SubField() function and specifying the field number. For example: SubField(Sentence, ' ', 4) Returns fox, the fourth word in the sentence, starting from the left of the string and using space as the delimiter. We can use a negative number to retrieve part of the string from the right. For example: SubField(Sentence, ' ', -2) Returns lazy, the second word from the end of the string. All in all, the SubField() function is very useful for quickly extracting parts of well-defined strings. It’s certainly easier than using nested combinations of Left(), Right(), Mid(), Len() or other Qlik text functions. Some more examples of where SubField() might prove useful: Extracting first or last names from a field containing the full name; Extracting a domain name from an email address; Extracting an area code from a phone number; and much more. Turning fields into rows with the SubField() function In the examples above we’ve used the third argument to specify the field number to retrieve. This is an optional argument. If omitted, the SubField() function can be used to split a string into individual rows. Consider the following table again: Load * Inline [ Sentence The quick brown fox jumps over the lazy dog]; We can use the SubField() function to split the sentence into individual words like this: Words:Load SubField(Sentence, ' ') as Word;Load * Inline [ Sentence The quick brown fox jumps over the lazy dog]; The resulting Words table will contain the 9 rows, one for each word in the sentence. Useful helper function: SubStringCount() The SubStringCount() function is useful when you want to know how many delimited fields a string contains. It takes a string and the substring to search for. For example: SubStringCount('The quick brown fox jumps over the lazy dog', ' ') Will return 8. “Why does it return 8 when the string contains 9 words?” The SubStringCount() function returns 8 because it isn’t looking for the words, but for the delimiter. The sentence contains 8 spaces, between 9 words. It’s good to keep this in mind. That’s it for this week, see you next Friday! More from the Bitmetric team Bitmetric Qlik Support Keep your Qlik environment running smoothly with proactive support that prevents issues before they appear. Available on flexible monthly plans. Learn more. Qlik vs Power BI Series See how Qlik and Power BI perform when theory meets reality. Three apps rebuilt, every step examined. Learn more. Qlik examentraining Functies Oplossing Hoe kunnen we je ondersteunen? Barry beschikt over meer dan 20 jaar ervaring als architect, developer, trainer en auteur op het gebied van Data & Analytics. Hij is bereid om je te helpen met al je vragen. Bel ons Mail ons 13 oktober 2026 TimeXtender 20.10 uit support vanaf december 2027: Classic of TDI? TimeXtender stopt in december 2027 met de ondersteuning van versie 20.10. Veel organisaties werken daar nog mee, en zij moeten overstappen naar TimeXtender Classic of naar TimeXtender Data Integration (TDI). Welke route past, hangt vooral af van je huidige omgeving en van je plannen voor de komende jaren. TimeXtender 5 oktober 2026 FabCon Europe 2026: de Fabric-updates die er echt toe doen Copilot gaat nu rechtstreeks aan de slag met je semantic models. Dat klinkt mooi, maar het betekent ook dat elk rommelig model een veel groter publiek krijgt. Wij zetten de FabCon Europe 2026-aankondigingen op een rij die er in de praktijk toe doen: van governance en capacity overage tot nieuwe tools voor data engineers. Plus wat we je nu al zouden aanraden. AI Evenement Microsoft Fabric Power BI 1 september 2026 Qlik Answers-review: wat we leerden van tests in de praktijk We testten Qlik Answers op een echt verkoopmodel in productie om te zien hoe het omgaat met analytics in de praktijk. De resultaten waren veelbelovend, maar voor betrouwbare antwoorden moesten we zorgvuldig werken aan het logische model, mastermetingen, dimensies en de bedrijfscontext. AI Data-analyse Qlik Semantic Layer
13 oktober 2026 TimeXtender 20.10 uit support vanaf december 2027: Classic of TDI? TimeXtender stopt in december 2027 met de ondersteuning van versie 20.10. Veel organisaties werken daar nog mee, en zij moeten overstappen naar TimeXtender Classic of naar TimeXtender Data Integration (TDI). Welke route past, hangt vooral af van je huidige omgeving en van je plannen voor de komende jaren. TimeXtender
5 oktober 2026 FabCon Europe 2026: de Fabric-updates die er echt toe doen Copilot gaat nu rechtstreeks aan de slag met je semantic models. Dat klinkt mooi, maar het betekent ook dat elk rommelig model een veel groter publiek krijgt. Wij zetten de FabCon Europe 2026-aankondigingen op een rij die er in de praktijk toe doen: van governance en capacity overage tot nieuwe tools voor data engineers. Plus wat we je nu al zouden aanraden. AI Evenement Microsoft Fabric Power BI
1 september 2026 Qlik Answers-review: wat we leerden van tests in de praktijk We testten Qlik Answers op een echt verkoopmodel in productie om te zien hoe het omgaat met analytics in de praktijk. De resultaten waren veelbelovend, maar voor betrouwbare antwoorden moesten we zorgvuldig werken aan het logische model, mastermetingen, dimensies en de bedrijfscontext. AI Data-analyse Qlik Semantic Layer