Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

dynamic update based on selection

Hello all,

I am trying to dynamically update fields on a table based on selection from another list.

Let's say this is the table:

NameValue
abc1
def1
xyz1

and this is the list:

Name
abc
def
xyz

I have an update button that I want to fix its action in a way that when I select from the list, let's say abc and xyz, and I hit the button, only the values of 'abc' and 'xyz' changes.

So the button's action is something similar to this:

UPDATE TableName SET Value = '1123' WHERE match(Name,'$(=GetCurrentSelections(Name))')

However this is not working. Any advice??

Thanks in advance!

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Hi,

Create a variable in Variable overview window like below,

Variable Name: vSelections.

Definition :    =If(GetSelectedCount(Name)>0, Concat(Chr(39) & Name & Chr(39),  ',' ,50))

Create a button and select action as "Dynamic Update" and statement like below.

UPDATE TableName SET Value = '1123' WHERE Match(Name,$(vSelections))

Attached sample file against your sample input.

View solution in original post

9 Replies
Chanty4u
MVP
MVP

=If( only({<[Name] = {$(vName)}>} value),

'UPDATE *

  SET Status = 0

  Where [Name] = $(vName);'

  ,

'UPDATE *

  SET Status = 1

  Where [Name] = $(vName);'

  )

Not applicable
Author

Thank you sureshqv for your reply. But excuse me I am new to qlikview. What do you mean by vName, what does the "v" stand for? It would be great if you can explain more. Thanks in advance.

tamilarasu
Champion
Champion

Hi,

Create a variable in Variable overview window like below,

Variable Name: vSelections.

Definition :    =If(GetSelectedCount(Name)>0, Concat(Chr(39) & Name & Chr(39),  ',' ,50))

Create a button and select action as "Dynamic Update" and statement like below.

UPDATE TableName SET Value = '1123' WHERE Match(Name,$(vSelections))

Attached sample file against your sample input.

Not applicable
Author

Perfect! Many thanks!!

Chanty4u
MVP
MVP

Hmmm nop.

That is variable name

for that there is one document  Please read this

https://community.qlik.com/blogs/qlikviewdesignblog/2013/11/04/the-magic-of-variables

and make helpful from the abve  replys which u got help .

Not applicable
Author

Hello again,

This is working perfectly on qlikview client however it is not work in web. Any Ideas?

tamilarasu
Champion
Champion

Hi,

Check whether the below options are enabled and try again.

Settings to enable in

QVW: Document properties -->  Server tab--> Enable Dynamic Data updateEnable Dynamic update.PNG

Server: QMC-->System-->Setup-->QVS-->Security--> Enable Allow dynamic data update

dynamic server.PNG

jochem_zw
Partner Ambassador
Partner Ambassador

Think the problem is in the where statement the quotes are missing, see attachment