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: 
Anonymous
Not applicable

explination of expr?


upper(left(path,index(path,'\',4)-1))

path is         \\zwcghtbu723\kmtot0123

how it works for this path

index(path,'\',4)

left(path,index(path,'\',4)-1)           give me explination pls

1 Solution

Accepted Solutions
its_anandrjs
Champion III
Champion III

Hi,

In expression index(path,'\',4) this search the position of ( '\' ) from left for 4th symbol that is not in the path if you use

index(path,'\',3) this gives 14

index(path,'\',2) this gives 2

index(path,'\',1) this gives 1

Similarly if you use

=left(path,index(path,'\',4)-1) 

This gives nothing but if you use

=left(path,index(path,'\',3)-1)

This gives nothing but if you use  string \\zwcghtbu723

From left of Path 14-1 = 13 means upto 13


Regards

Anand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

index(path,'\',4) will return the position of the 4th \ character in the text string value of the path field. In your example there are only three \ characters so this returns 0. 0-1 is -1. The left function doesn't accept a negative length so the expression will return null.


talk is cheap, supply exceeds demand
its_anandrjs
Champion III
Champion III

Hi,

In expression index(path,'\',4) this search the position of ( '\' ) from left for 4th symbol that is not in the path if you use

index(path,'\',3) this gives 14

index(path,'\',2) this gives 2

index(path,'\',1) this gives 1

Similarly if you use

=left(path,index(path,'\',4)-1) 

This gives nothing but if you use

=left(path,index(path,'\',3)-1)

This gives nothing but if you use  string \\zwcghtbu723

From left of Path 14-1 = 13 means upto 13


Regards

Anand