Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Inserting value into a column of TableBox

Hello

I have a TableBox Object that loads with certain columns and data.

In a macro I need to be able to add a column to this TableBox, that I can do by

set tb = ActiveDocument.GetSheetObject("TB06")

  tb.AddField("CampaignId")

But then in this column I need to insert a value for every row (every row will have the same value)

The reason I have to do this afterwards is because I have to insert some other data in a database and get an Id back before I can set the value of this column.

Is there a way of doing this?

1 Reply
Gysbert_Wassenaar

There's a dynamic update action you may be able to use. From the help file:

Dynamic Update

Performs a dynamic update of the data in the currently loaded document. The statement for the dynamic update is to be entered in the Statement field.

The intended usage of Dynamic Update allows a QlikView Administrator to feed limited amounts of data in to a QlikView document from a single source without running a reload of the document. Analysis can then be performed by multiple clients connecting to the QlikView Server.

Note! The uploaded information is stored in RAM only so any data added or updated using Dynamic Update will be lost if a reload of the document is performed.

The following grammar describes the possible statements and their components that can be used with the Dynamic Update feature:

  • statements ::= statement { “;” statement }
  • statement ::= insert_statement | update_statement | delete_statement | begin_transaction_statement | commit_transaction_statement
  • insert_statement ::= "INSERT" "INTO" ("*" | table_name) field_list "VALUES" value_list {"," value_list} ["KEY" ["AUTO" | (" (" field_list ")")] ["REPLACE" (["WITH" "ONE"] | "EACH") ]]
  • update_statement ::= "UPDATE" ("*" | table_name) set_clause {"," | set_clause} "WHERE" condition ["AUTO" "INSERT"]
  • delete_statement ::= "DELETE" "FROM" ("*" | table_name] "WHERE" condition
  • begin_transaction_statement ::= "BEGIN" ("TRANSACTION" | "TRAN") [trans_name]
  • commit_transaction_statement ::= "COMMIT" ["TRANSACTION" | "TRAN"] [trans_name]
  • table_name ::= identifier | quoted_name
  • field_list ::= "(" field_name {"," field_name} ")"
  • value_list ::= "("value {"," value} ")"
  • set_clause ::= "SET" field_name "=" any_valid_non_aggregated_qlikview_expression
  • field_name ::= identifier | quoted string
  • value ::= identifier | any_qlikview_number | quoted string
  • condition ::= any_valid_non_aggregated_qlikview_expression
  • identifier ::= any_qlikview_identifier
  • quoted_string ::= "[" [^]]+ "]"

Example:

UPDATE AbcTable SET Discount = 123 WHERE AbcField=1

Note! To use this feature, Dynamic Update must be allowed both on the Document and on the Server.


talk is cheap, supply exceeds demand