A company stores the employee data within a key composed of Country UserlD, and Department. These fields are separated by a blank space. The UserlD field is composed of two characters that indicate the country followed by a unique code of two or three digits. A data architect wants to retrieve only that unique code.
A. LTRIM (SUBFIELD (Key, ‘ ‘, 2), 2)
B. RIGHT(SUBFIELD (Key,’ ‘, 2), 3)
C. LEFT(SUBFIELD(Key, ‘ ‘, 2), 2)
D. MID ( SUBFIELD (Key , ‘ ‘, 2), 3)
Answer:C
A company stores the employee data within a key composed of Country UserlD, and Department. These fields are separated by a blank space. The UserlD field is composed of two characters that indicate the country followed by a unique code of two or three digits. A data architect wants to retrieve only that unique code.
A. LTRIM (SUBFIELD (Key, ‘ ‘, 2), 2) B. RIGHT(SUBFIELD (Key,’ ‘, 2), 3) C. LEFT(SUBFIELD(Key, ‘ ‘, 2), 2) D. MID ( SUBFIELD (Key , ‘ ‘, 2), 3)
Explanation: This expression will extract the unique code from the key by using the SUBFIELD function to separate the key into its components, and then using the LEFT function to extract the first two characters of the second component. Source: Qlik