Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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:
Name | Value |
---|---|
abc | 1 |
def | 1 |
xyz | 1 |
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!
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.
=If( only({<[Name] = {$(vName)}>} value),
'UPDATE *
SET Status = 0
Where [Name] = $(vName);'
,
'UPDATE *
SET Status = 1
Where [Name] = $(vName);'
)
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.
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.
Perfect! Many thanks!!
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 .
Hello again,
This is working perfectly on qlikview client however it is not work in web. Any Ideas?
Think the problem is in the where statement the quotes are missing, see attachment