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

selected value in the list box

can you please give the macro code for how to get the selected value in the listbox in one variable .

thanks in advance

9 Replies
Not applicable
Author

you can use a variable with value
=GetFieldSelections(FIELDNAME)

Alex

Not applicable
Author

hi alex thanks for replay

hear is my code



set

LB = ActiveDocument.GetSheetObject("LB01"

)

set

boxfield=LB.GetField

set

value=GetFieldSelections("LB01"

)





i am getting this error Type mismatch: 'GetFieldSelections' can you pls tell me how to solve this



Not applicable
Author

Hi

You have misunderstood the solution, you don't need to create a macro for this, just a variable.

Go to Settings, Variable Overview.

Click on Add

Create a variable name

Go to that variable, then in the content pane below, add the code as specified above ........ = GetFieldSelections("YourFieldName")

Your variable will then always contain the selected field from the list box.

Cheers,

Not applicable
Author

Hi Nigel West ,

i need to set the condition acording to the selected value in the list box how to relate thisto get selected value.

can you please give the condition how to relate the condition please.

Thanks in advance

Not applicable
Author

Hi

Let's assume you call your variable vSelValue, your expression should look something like:

=IF(vSelValue = 'Value1' , Sum(Val1) , IF(vSelValue) = 'Value2' , Sum(Val2) , Sum(Val3) ) )


Is this what you are after?

Not applicable
Author

Hi nigel i am new to the qlik view

can you plese solve my problem i have the list box [list box id is "lb01" and field name is change_direction ] haveing the values increase and cerease when i select the option increase the table box coloum values come above grater than 0 and i select the decerase the table box coloum values come above less than 0 acording to the selection the table values should be dispalyed

table id =tb03

and table field coloum id proj_pats_pcnt_chg_lm

pls do the need the full

Not applicable
Author

Hi

Very sorry but I really don't understand what you are asking.

Can you post a sample QVW and put some text boxes in it to explain what it is you want?

Not applicable
Author

hear i am attching preview of my document in the you can find increase and decrease options in the list box when i click the increase option in the list box the table per_change_lm values should be dispalyed greater than 1 pls can see the sheet you can easilly under stand what i am asking.

thanks for replay

ToniKautto
Employee
Employee

As you are new to QlikView my suggestion is that you start by creating your app without using macros, as this way you will learn to maximize the QlikView features. Macros will also make you app less usable if you access it over AJAX.

If you need help to solve a specific scenario, please provide a sample of you QVW file to allow proper evaluation of your current data model and document objects. In case the file contains sensitive data, please scramble it to make the content unreadable;

Settings > Document Settings > Scrambling