Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
bhusjosh
Contributor II
Contributor II

GetCurrentSelections() in texbox

Hello Experts,

 

I am using GetCurrentSelections() function in text object to represent my current selections of whole dashboard, but now i want to restrict few fields from this, Could you please help me to design the same?

9 Replies
tresesco
MVP
MVP

May be use multiple GetFieldSelections() instead
bhusjosh
Contributor II
Contributor II
Author

Yeah, I have 20 plus filters and have restrict only 2 fields, i am using Replace within text objects and modifying this but additional commas appearing , need to restrict that.

tresesco
MVP
MVP

Well, if you are using replace() to resolve the issue, I guess with small tricks you could even get rid of those additional commas. Could you share the expression you are trying with and the output you are getting?
bhusjosh
Contributor II
Contributor II
Author

='Current Selections - '&replace(replace(replace(replace(replace(replace(Replace(replace(replace
(replace(replace(replace(replace(replace(replace(Replace(Replace
(replace(Replace(GetCurrentSelections(' | '),
[Comparison Elements],''),'Comparison Elements',''),'FT2',''),FT2,''),'("S&OP-1"|"FBP")',''),'("FBP"|"CY-1")',''),'R&OP',''),'CY-1',''),'CY-2',''),'CYP1','')
,'SNOP','')
,'FBP',''),'MUD',''),'JUD',''),'SUD',''),'NUD',''),'S&OP-1',''),'ALL','')
,[Reporting Month],date([Reporting Month],'MMM-YY')) 

This is the expression and 5 values are selected in Comparison Elements field.

And output for the same is 

 

Current Selections - Reporting Month: Apr-19 | Region: LATAM | : , , , ,  | : 

 

I want to avoid that | symbol and commas as well.

Thanks for your response.

 

 

 

ajaykakkar93
Specialist
Specialist

hi,

You can even try to edit from this post Document-Chaining-in-Qlik-Sense, for your case

tresesco
MVP
MVP

So you want only two fields selections out of twenty fields or 18 out of 20? i.e - exclude 2 or include 2?

bhusjosh
Contributor II
Contributor II
Author

18 out of 20
tresesco
MVP
MVP

Try like below:

=Replace(
Replace(
Replace(
'|'&GetCurrentSelections('|',':',',')&'|',
TextBetween('|'&GetCurrentSelections('|',':',',')&'|' , '|Field1','|'),
''
),  '|Actor', '')
,
TextBetween('|'&GetCurrentSelections('|',':',',')&'|' , '|Field2','|'),
''
)

 

Replace Field1, Field2 with your fields that you would want to exclude from the result

bhusjosh
Contributor II
Contributor II
Author

Hi tresesco,

Thanks for your continous support.

I am trying this option but no luck.

Could you please forward me .qvw where you implemented this.

 

Regards,

Bhushan