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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help in using subfield function

Hi All,

I have a filename as 'MM.YYYY Test_name Sample_test.xls'.

I want to just store the part Test_name Sample_test in a field .

Thanks,

Asma

1 Solution

Accepted Solutions
rubenmarin

Ok, I misundertood, then is easier because the first part to ignore has 8 fixed characters, it can be:

=Mid('MM.YYYY Test_name Sample_test.xls', 9, Index('MM.YYYY Test_name Sample_test.xls', '.', -1)-9)

View solution in original post

4 Replies
rubenmarin

Hi Asma, in example:

'Test_name': =Subfield('MM.YYYY Test_name Sample_test.xls', ' ', 2)

'Sample_test': =Left(Subfield('MM.YYYY Test_name Sample_test.xls', ' ', -1), Index(Subfield('MM.YYYY Test_name Sample_test.xls', ' ', -1), '.', -1)-1)

If Test_name or Sample_test can have blank spaces it could be a problem, as you can't identify which part will be the Test_name and wich one is the Sample_test.

Not applicable
Author

I want to store Test_name Sample_test, this entire thing in a single variable.

Is it possible by some other way rather than using subfield function

rubenmarin

Ok, I misundertood, then is easier because the first part to ignore has 8 fixed characters, it can be:

=Mid('MM.YYYY Test_name Sample_test.xls', 9, Index('MM.YYYY Test_name Sample_test.xls', '.', -1)-9)

Not applicable
Author

Thanks for such a quick reply