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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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

Labels (1)
1 Solution

Accepted Solutions
rubenmarin
MVP
MVP

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
MVP
MVP

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
MVP
MVP

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