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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
gunji
Partner - Contributor
Partner - Contributor

Value of the variable

Hi,

Can any one help me on the below query.

LET vValue= MID(DocumentTitle(),INDEX(DocumentTitle(),'[')+1,INDEX(DocumentTitle(),']')-INDEX(DocumentTitle(),'[')-1);

What will be the vale of the variable.

 

Thanks,

Hareesh.

 

Labels (1)
1 Solution

Accepted Solutions
justISO
Specialist
Specialist

Gunji formula works fine, and it is even more advanced as IamBack suggested, because it is shows string between [] even though there are more characters after that:

justISO_0-1661235162624.png

 

View solution in original post

6 Replies
justISO
Specialist
Specialist

Hi, this variable extracting string between brackets of your app name. So, for example, let say your app you are working on is called

app_name[potato]next_part

so with this variable you take app name with function DocumentTitle() and extracting everything between [], where index function is showing the places of []. So answer will be

potato

If in app name there are no brackets, answer will be empty.

SunilChauhan
Champion II
Champion II

I thing Below gives  string between [ and ]

MID(DocumentTitle(),INDEX(DocumentTitle(),'[')+1,INDEX(DocumentTitle(),']')

 

and INDEX(DocumentTitle(),'[')-1)  shows Number 

i thing there may be Error as we Cannot Subtract String  minus number

i Susspect correct should 

MID(DocumentTitle(),INDEX(DocumentTitle(),'[')+1,INDEX(DocumentTitle(),']')-1);

Sunil Chauhan
justISO
Specialist
Specialist

Gunji formula works fine, and it is even more advanced as IamBack suggested, because it is shows string between [] even though there are more characters after that:

justISO_0-1661235162624.png

 

gunji
Partner - Contributor
Partner - Contributor
Author

Hi,

 

Thanks for your quick response.

 

Thanks,

Hareesh.

gunji
Partner - Contributor
Partner - Contributor
Author

Hi,

Thanks for your quick response.

 

Thanks,

Hareesh.

SunilChauhan
Champion II
Champion II

i think Simply we can use 

 

Textbetween(documentTitle(),'[',']')  so it give result between square bracket.

Sunil Chauhan