Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
new_guy
Contributor III
Contributor III

Subfield

Hello,

I have the following example data within the field "App Name":

 

ApplicationName 
ApplicationName v0.01
ApplicationName _v01
ApplicationName2
ApplicationName vs. ApplicationName

 

 

 Now i want to place a filter on my worksheet to filter different versions. So my filter should only contain entries like v01, v0.01,v12.12 etc.

I've tried a lot up to now but nothing really works. 

With :

if("App Name" like '*v*.*',Subfield(Right("App Name",5),' ',-1),'eine version') AS Version,

i get all of the versions but also "nName" of  "ApplicationName vs. ApplicationName". 

I then tried:

if("App Name" like '*v*.*',if(isNum(num#(Subfield("App Name",'v',-1),'*.*')),Subfield("App Name",'v',-1),'eine version')) AS Version,	

but this wont work at all. 

 

Is there a nice way to tell Qlik Sense like look if there is something like v0.10 and then only take this and put it into a field"?

1 Solution

Accepted Solutions
new_guy
Contributor III
Contributor III
Author

I now used the following:

 

if("App Name" like '*v*.*',
    	if(FindOneOf(keepchar(Subfield("App Name",'v',-1),'0123456789v.()'),'0123456789')<>0,keepchar(Subfield("App Name",'v',-1),'0123456789v.()'),'only one Version'),'only one Version') AS Version,

This works pretty well up till now, but as @Vegar  said, the best way to solve is to generalize the naming of my apps. 

View solution in original post

6 Replies
miskinmaz
Creator III
Creator III

Use keepchar()
Vegar
MVP
MVP

Try the following script. It will return data like in the table below.

image.png

LOAD 
* , alt(num(mid(App,index(App, 'v', -1)+1)), dual('N/A', 0)) as Version Inline [ App ApplicationName ApplicationName v0.01 ApplicationName _v01 ApplicationName2 ApplicationName vs. ApplicationName ];
sunny_talwar

Based on your input data provided... which one of the app names should display a version and which one would display null?

new_guy
Contributor III
Contributor III
Author

everything but the "App Name vs. App Name" should be displayed with its version number 🙂
Vegar
MVP
MVP

Is hard to create smart parsing on a ungoverned text string, I would probably explore @miskinmaz suggested solution.

keepchar(ApplicationName, '0123456789.') as version,
new_guy
Contributor III
Contributor III
Author

I now used the following:

 

if("App Name" like '*v*.*',
    	if(FindOneOf(keepchar(Subfield("App Name",'v',-1),'0123456789v.()'),'0123456789')<>0,keepchar(Subfield("App Name",'v',-1),'0123456789v.()'),'only one Version'),'only one Version') AS Version,

This works pretty well up till now, but as @Vegar  said, the best way to solve is to generalize the naming of my apps.