Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Make a Current Selection Box more friendly

Hi,

I wonder if it is possible to show in a current selection box the caption of the fields instead of its original name. For example, in the attached image I would like to show in the current selection box 'Temporada' instead of 'TEMP_PSERV'.

13-05-2013 12-28-46.png

Thanks.

1 Solution

Accepted Solutions
flipside
Partner - Specialist II
Partner - Specialist II

Hi,

I'm not sure it is possible to show the label in Current Selections. An alternative would be to use a text box and the GetFieldSelections function, but it takes some work to get it to look right and you will lose the erase and dropdown icons for example.

Here's how I did it ...

First create a table for the source name and label and then create the individual GetFieldSelections for each field. Then concatenate each expression into a single expression ...

Alias:

Load *, 'if(GetFieldSelections(' & InternalField & ')>0,' & chr(39) & left(AliasField & repeat(' ',10),20) & ' = ' & chr(39) & ' & GetFieldSelections(' & InternalField & ')' as string;

Load * inline [

InternalField,             AliasField

RunningTotal_ID,         Running Total

ID,                              Record Identifier

Sales,                          Sales Reference #];

tmp:

Load concat(string,' & chr(13)) & ') as tmpString resident Alias;

let eCurrSelections = '=' & peek('tmpString') & ')';

drop table tmp;

In my example I have three fields aliased, but the major issue would be managing this ongoing, ensuring new fields are included etc..

Finally refer to the expression variable in a text box (using font Courier New makes alignment better) ...

=If(IsNull(eCurrSelections),'No Selections Made',eCurrSelections)

If you retain the Alias table as an island table, you can call the labels to your objects in this format ...

=FieldValue('AliasField',FieldIndex('InternalField','ID')) - where ID is my source field in this case.

flipside

View solution in original post

2 Replies
flipside
Partner - Specialist II
Partner - Specialist II

Hi,

I'm not sure it is possible to show the label in Current Selections. An alternative would be to use a text box and the GetFieldSelections function, but it takes some work to get it to look right and you will lose the erase and dropdown icons for example.

Here's how I did it ...

First create a table for the source name and label and then create the individual GetFieldSelections for each field. Then concatenate each expression into a single expression ...

Alias:

Load *, 'if(GetFieldSelections(' & InternalField & ')>0,' & chr(39) & left(AliasField & repeat(' ',10),20) & ' = ' & chr(39) & ' & GetFieldSelections(' & InternalField & ')' as string;

Load * inline [

InternalField,             AliasField

RunningTotal_ID,         Running Total

ID,                              Record Identifier

Sales,                          Sales Reference #];

tmp:

Load concat(string,' & chr(13)) & ') as tmpString resident Alias;

let eCurrSelections = '=' & peek('tmpString') & ')';

drop table tmp;

In my example I have three fields aliased, but the major issue would be managing this ongoing, ensuring new fields are included etc..

Finally refer to the expression variable in a text box (using font Courier New makes alignment better) ...

=If(IsNull(eCurrSelections),'No Selections Made',eCurrSelections)

If you retain the Alias table as an island table, you can call the labels to your objects in this format ...

=FieldValue('AliasField',FieldIndex('InternalField','ID')) - where ID is my source field in this case.

flipside

Stefan_Walther
Employee
Employee

If you are using the Ajax Client, you could use the following extension I have created some days ago: http://www.qlikblog.at/2412/qliktip-better-current-selections-box-translate-hide-fields/

Regards

Stefan