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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
venkatg6759
Creator III
Creator III

Help needed with keepchar()

Hello Everyone,

I have the following expression

left(keepchar(if([Research - US Shares ()]&','&[Overall - US Shares ()]&','&[Research - All Products ()]&','&[Overall - All Products ()]<>',,,',[Research - US Shares ()]&','&[Overall - US Shares ()]&','&[Research - All Products ()]&','&[Overall - All Products ()]),'0123456789'),1).

Which gives me results like as shown

I need the highlighted cell to show result as 11

Logical.PNG.png

11 Replies
venkatg6759
Creator III
Creator III
Author

if it is 1 or 2 it should be displayed as 1 ,if tier 2 it should be 2 . if top 10 it should be 10.

preminqlik
Specialist II
Specialist II

Hi there please find attachement

=if(len(subfield(trim(keepchar(rtrim(ltrim(replace([EMEA & Asia logic],',',' '))),' 0123456789')),' ',1))>0,subfield(trim(keepchar(rtrim(ltrim(replace([EMEA & Asia logic],',',' '))),' 0123456789')),' ',1),

trim(keepchar(rtrim(ltrim(replace([EMEA & Asia logic],',',' '))),' 0123456789')))