Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Update column with Dynamic Update?

Dear All,

I have a problem when i try update a column with dynamic update as following:

I load table FunctionType:


FunctionType:
Load * inline
[FunctionKey, A, B
1, 3, 3
2, 3, 1
3, 2, 1
4, 4, 2];


I want to update column B with rule:

if A>vLowSkill then B=vLowSkill

So I wrote a VBScript:


sub vbLowSkillUpdate

' Get new value
SET objSource = ActiveDocument.Variables("vLowSkill")
strValue = objSource.GetContent.String

set docprop = ActiveDocument.GetProperties
docprop.EnableDynamicDataUpdate=true
ActiveDocument.SetProperties docprop

' Update
query="UPDATE FunctionType SET B="& strValue & " WHERE A>"&strValue&" "
set sqlerror=ActiveDocument.DynamicUpdateCommand(query)

if (sqlerror = false) then
'MsgBox sqlerror.errormessage
msgbox(query&chr(10)&"Update has error!")
exit sub
end if

end sub


But it didn't update anything when I input new value for vLowSkill.

I don't know how to correct it.

Please help me to solve this problem!

Tmthai

3 Replies
Not applicable
Author

Hi Tmthai,

The problem is with ">" in where clause, it seems that only "=" works with where clause in case of dynamic data updates. I am not sure why ">" is not allowed, maybe its not supported as of now. See if you can work out with "=" instead of ">".

Thanks

Amit

Not applicable
Author

Hi Amit,

Thank your for your answer.

You are true, It may be a problem of QlikView.

In my case, I must use '>' so i tried by another way. I used if(condittion, value1, value2) as it was presented on page 24 of QlikView Automation Reference

But it still not work

Oh, my God!

The problem seems commonly but why It didn't work???

Regards,

biester
Specialist
Specialist

Hi,

in fact I have no solution for this one, but just to inform you that I opened a support case regarding this (and also other) issues on dynamic data update. The feature doesn't seem to be stable or ripe yet. Be sure I will report as soon as I get an answer from the QlikView-Support team.

Regards,
Joachim