Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
subfield([qvd source],'\',substringcount([qvdsource],'\')+1)
what it do ?
The expression appears to be grabbing the file name from a fully qualified file location. Here are 2 examples of what this expression would return.
[qvd source] subfield([qvd source],'\',substringcount([qvdsource],'\')+1)
----------------------------------------------------------------------------------------------------------
c:\temp\file.qvd file.qvd
c:\temp\test\file2.qvd file2.qvd
In its three-parameter version, this script function returns a given substring from a larger string s with delimiter 'delimiter'. index is an optional integer denoting which of the substrings should be returned. If index is omitted when subfield is used in a field expression in a load statement, the subfield function will cause the load statement to automatically generate one full record of input data for each substring that can be found in s.
In its two-parameter version, the subfield function generates one record for each substring that can be taken from a larger string s with the delimiter 'delimiter'. If several subfield functions are used in the same load statement, the Cartesian product of all combinations will be generated.
Examples:
(For three parameters)
subfield(S, ';' ,2) returns 'cde' if S is 'abc;cde;efg'
from Qlik help
The expression appears to be grabbing the file name from a fully qualified file location. Here are 2 examples of what this expression would return.
[qvd source] subfield([qvd source],'\',substringcount([qvdsource],'\')+1)
----------------------------------------------------------------------------------------------------------
c:\temp\file.qvd file.qvd
c:\temp\test\file2.qvd file2.qvd
Hi,
Source is like //abc/cde/ghi
substringcount(source,'/') it will give 4
then subfield(source,'/',4+1(5))
suppose here we have like this subfield([qvd source],'\',substringcount([qvdsource],'\'))
subfield(source,'/',4) that is subfield(source,'/',4) it will give ghi