Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
anuradhaa
Partner - Creator II
Partner - Creator II

Get user input values and assign that to variables using macro

Hi

I want to create a button as "Set variable Value" then once user click it it has to display a pop up and user can input values.

after he input that value has to assign to a variable.

can i do this using macro?

Thanks

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

I still claim that you should avoid macros. And you should use an Input box. A pop-up is not easier for a user to manage.

You can do it the following way:

1) Use an Input box for your vSales variable.

2) Goto Document properties - Triggers

3) Mark your vSales under "Variable event triggers"

4) Add Action "Select in field" and add the appropriate search string.

HIC

Image3.png

View solution in original post

7 Replies
hic
Former Employee
Former Employee

No, you shouldn't do it that way. Macros are bad.

Instead I suggest you use an Input box. It is designed to do exactly that; to let users set variable values.

HIC

anuradhaa
Partner - Creator II
Partner - Creator II
Author

Currently i'm using input box but i have some problems,

see i have sales field,

Then in my input box i take vsales,

then based on that value i have to select all the sales grater than vsales and adjust whole sheet based on that selection criteria. but currently it don't happen. i have to select all sales after set vsales value.

Also inputbox UI editing is difficult. If you can pls send me a doc to learn input box UI enhancements. Also please give me a suggestion to my question

Thanks

ashfaq_haseeb
Champion III
Champion III

Hi,

look at the attached application.

Hope it helped.

Note

In-order this to work you must at-least select one value from the list box.

Regards

ASHFAQ

anuradhaa
Partner - Creator II
Partner - Creator II
Author

Thank You for you help, but i can't use predefined values

hic
Former Employee
Former Employee

I still claim that you should avoid macros. And you should use an Input box. A pop-up is not easier for a user to manage.

You can do it the following way:

1) Use an Input box for your vSales variable.

2) Goto Document properties - Triggers

3) Mark your vSales under "Variable event triggers"

4) Add Action "Select in field" and add the appropriate search string.

HIC

Image3.png

anuradhaa
Partner - Creator II
Partner - Creator II
Author

Grate That works.

Could you please tell me is there a way to reset variable in input box by clicking on a button with out macro.

Note - i want to reset is , not 0. because i have negative values too

hic
Former Employee
Former Employee

You don't need to reset the variable. Just clearing the selection by clicking the clear button in the toolbar will reset the selection.

Alternatively, you can change the variable value to blank in the input box. Or you can create a button with an action that sets the variable to blank.

HIC

Image4.png