Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to use Dynamic update action in QV 11

Hi,

Can any one tell me how to use the Dynamic update action in QV 11 .. Do We need to write macro to use this?

53 Replies
bob_zagars
Contributor II
Contributor II

Matthias Dix,

Does this Dynamic Update only pertain to in memory data?  I am building something like the budget process where I need to update budget amounts to the source via INPUTFIELD values.  The loop would be all changes.

IF ValueChanged THEN

     UPDATE BudgetTable SET CurrentBudget = FieldValue(INPUTFIELD) WHERE BudgetTable.RowID = RowID;

END IF

Thanks,

Bob

Not applicable
Author

Not applicable
Author

Hi Matthias Dix,

Is there anyway to set the sql statement "VALUES" by using variables or getFieldSelections()?

Not applicable
Author

What exactly are you trying to do? Did you check my example from this thread here?

I've used both variables and getFieldSelections in combination with Dynamic Update in the past. It seems to be easier to build up an SQL-Statement in makro (using loops etc.) and fire that with:

ActiveDocument.DynamicUpdateCommand (SQL_String)

Keep two things in mind:

  • makros won't work in  AJAX
  • getFieldSelections is limited to a defined amount of values (I used a max of 1.000 values per SQL-Update)

Let me know if you need more information. I'd be glad to share my knowledge with the community 🙂

Not applicable
Author

Hi,

Thanks. But I managed to do in this way...please refer to SQL statement below.

INSERT INTO *

(Created_DateTime, Name,Target_Period,Target_Customer_Type,Target_Age_Group,Target_Race,Target_Marital_Status,

Target_Gender,Target_Religion,Target_Line_of_Business,Target_Product_Group,Target_Period_From,Target_Period_To)


VALUES (=$(vCreatedDate), $(vName), $(vPeriod), =$(vCustType), =$(vAgeGroup), =$(vRace), =$(vMaritalStatus), =$(vGender), =$(vReligion), =$(vLOB), =$(vProductGrp), $(vPeriodFrom), $(vPeriodTo))

The VALUES statement is getting the value from qlikview variables

Thanks anyway. 😃

By the way, I had another issue, I would like to export data from a chart to multiple qvd and name the qvd file with current date and time. Any advice?

Sub export

set obj = ActiveDocument.GetSheetObject("CHExport")

File = activedocument.Evaluate("'Output QVD\20130101_Master_Table.qvd'")

obj.ExportEx File, 4

end sub

Refer to the codes in BOLD above, I would like to dynamically name the qvd. Can I put variable in that statement?

regards

Not applicable
Author

Hi CS Khoo,

why are you using = only sometimes in your SQL statement?

What is the Evaluate-Function doing with your filename?

Be aware that there are two possible ways for exporting - at client and at server side.

I solved export with variable filenames like this:

Dim Path

set Path = ActiveDocument.Variables("vRootFolder")

dim Timestamp

Timestamp=ActiveDocument.Evaluate("timestamp(Now(),'YYYYMMDDhhmmss')")

ExportTable.ServerSideExportEx Path.GetContent.String & "02_Datenquellen\DUMMYsave_" & Timestamp & ".xml" ,";", 3 '0=HTML, 1=Text, 2=Bitmap, 3=XML, 4=QVD, 5=BIFF

or

ExportTable.ExportXml Path.GetContent.String & "02_Datenquellen\DUMMYsave_" & Timestamp & ".xml"

sebastiandperei
Specialist
Specialist

Hi Dix! I will post a question about Dynamic Update, in order to put it as Answered when you do (this post would be mark like that!!)

It subject will be "Dynamic Update from InputField". Please, I like you see it!

Christian_Lauritzen
Partner - Creator II
Partner - Creator II

Matthias!

Thanks for your great examples. I have tried to apply what I can pick up from then, but I end up struggling in vain to make update queries work, at least the way I wish to use them.

I am trying to make a data cleaning tool that updates possible values in a table based on input.

Would be extremely grateful if you could have a look at the attached QVW. 

I uploaded my attempt, even if it is far from working... I think such tool, when working, would be a great help for many in the community.

/Christian

Email: christian.lauritzen@b3.se
Not applicable
Author

Hai  Dix,

I am new to Qlikview and to dynamic update as well. I have one question could you please help me solve.

I am using Dynamic Update,

Before I insert the data into the table using insert in want to completely remove all the records and insert the new data.

How do I achieve this?

Not applicable
Author

Hi Matthias,

i didn't find a hint until now so I need to ask you: Do you know a way to trrigger a dynamic update action frrom an object extension?

Thanks a lot in advance,

Martin