Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get current selection of a bar chart

Hello guys,

I would like to know how can I get the current selection that is being show on a bar chart.

My bar chart has this calculated dimension:

=if(mid([KNRSCI],3,1)<>'7',

if([CodigoFalhaSCI]<>Null,(SubField([DescricaoModuloSCI],' Test',1)&': DTC - '&[CodigoFalhaSCI]&' - '&[DescricaoFalhasSCI]&' ('&[EstatisticoFalhasSCI]&')'),(SubField([DescricaoModuloSCI],' Test',1)&': '&[DescricaoFalhasSCI]&' ('&[EstatisticoFalhasSCI]&')')))

How can I get that current selection to use on another chart (for example) without using this calculated dimension?

Thank you in advance.

Best Regards.

Ivo Marques

7 Replies
maleksafa
Specialist
Specialist

=replace(replace(GetCurrentSelections(' | ','='), 'NTNAME=' & getfieldselections(NTNAME) & ' | ' ,''), 'NTNAME=' & getfieldselections(NTNAME) ,'')

Not applicable
Author

Hello Malek,

Thank you for the answer.


What is the NTNAME variable on your expression?

Is it the ID of the bar chart?

Because if it is the ID does not seem to be working.

sivarajs
Specialist II
Specialist II

create a variable and paste your expression

use GetCurrentSelections(variablename)

Not applicable
Author

Hello Sivaraj,  I create the variable on the Variable Overview tool but my expression has logical expressions (If cases) I don't think you can create variable with logical tests.
d_pranskus
Partner - Creator III
Partner - Creator III

My suggestion would be, if possible, to calculate the values of that dimension in the load script. The only way this might be not possible, if the dimension is dynamic. If it consists of the fields from several tables, you can still use joins to get that done in the load script.

maleksafa
Specialist
Specialist

you can use simply the =GetCurrentSelections() function.

Not applicable
Author

Hello Darius,

Your suggestion is nice, but I'm afraid I cannot implement it because in my app the user can make several selections and they should be dynamic, so if I put this in the loading script, that value is always the same, right?

Best regards.