Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable input box that updates a column but based on selection

Hi -

I have a variable input box where a user types in the value and the value would update the adjusted column. The problem I have is that when you type in the value in the input box, it updates all values in the table. I would like to filter for specific data and only update the values selected from the variable box.

Example:

REGIONCOUNTRYSum (SALES)NPI Adj% Adj
18040.001.5
AMERICANSUSA100.001.5
ASIACHINA500.001.5
EUROPEGERMANY303.331.5
EUROPEITALY404.441.5
EUROPEUK505.561.5

I only want to populate % Adj with 1.5 for Europe using input box but now it populates the complete column. I found someone wrote a macro do update only selected fields but didn't work.

Would you have any solution? I have attached my example.

9 Replies
Not applicable
Author

Hi,

Instead of using a Variable, you can use InputFields.

You have to define a field during you load script as Input field. Then you can change it at the column level.

Not applicable
Author

I have am using that as well but this will be thousands of rows of data and I cannot have the user input that many values. I want the user to select specific data and populate the column. so if user selects country as 'Europe' the value from the variable field will only populate column with that value for Europe. See my example attached above

aveeeeeee7en
Specialist III
Specialist III

Hi

See the Attachment.

Hope it will help you.

Regards

Aviral Nag

Not applicable
Author

Hello Avril -

When I select Europe for example and type in 2 or 3, it still updates all other countries. What I want is if I select something in my select box, to just update that country or region and leave the rest as is.

I have been trying to figure it out but am not able to.


Thank you so much for all your help!!!

Not applicable
Author

Hi Aviral -

Your solution worked as well as mine. But just to clarify, if I select one country, I just want to update the values for that country not others. Would you know how I can do that please?

Thanks

Not applicable
Author

Hi petraraczynski,

I am new to QlikView,  but I guess this can be resolved using one more variable. Let say 'vUpdateCountry' that stores the selected country value.

To store the value of selected country you can use a function

=GetFieldSelections([filedname],'',1).

Here mentioning 1 would just store one selected country in the variable if you want multiple selections then you can change it to 3 or 5 or whatever is your requirement. There are more functions available to perform the same tasks like 'concat' and 'maxstring'.

This will store the value in the variable vUpdateCountry, and I am assuming that you can use this variable in the update syntax as a condition to update the % Adj field only for the selected country.

Hope this answer would help you solve the issue. 

Thanks & Regards

VinayG

Not applicable
Author

Vinay -

I still can't see how that will resolve my issue. See my sample here. So if I select Germany, my Adjust Projected % should only update Germany. Not sure how that extra variable will resolve it.

Thanks

Not applicable
Author

Vinay -

I can't get that to work and I will have about 10 different selections. How would you make that work?

Thanks

Not applicable
Author

Hello -

I still can't get this to work. can you please let send me the sample if you can?

Thanks,