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: 
bhusjosh
Contributor III
Contributor III

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 III
Contributor III
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 III
Contributor III
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 III
Specialist III

hi,

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

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

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 III
Contributor III
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 III
Contributor III
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