Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. READ MORE

How to copy and update data to Microsoft Excel sheet using Qlik Automations (small datasets)

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
PietMichielRappelet
Former Employee
Former Employee

How to copy and update data to Microsoft Excel sheet using Qlik Automations (small datasets)

Last Update:

Feb 9, 2023 10:39:11 AM

Updated By:

Sonja_Bauernfeind

Created date:

Jan 19, 2022 8:06:23 AM

Attachments

This article elaborates on keeping a Microsoft Excel table in sync with data from e.g. a cloud system or a Qlik Sense table.

Content:

 

Qlik Application Automations can be used, however I would like to share some important need-to-knows and limitations of the Microsoft Excel connector:

Limitations

  • The Microsoft Excel connector in Automations is not designed for data movement of large datasets.  The performance of the 'upsert' pattern is not great because there is no native support to find table indexes for matching id's.  The used 'find row in sheet' block lists and loops through all records to find a match causing bad performance. 
  • It is advised to work inside a worksheet session for performance reasons and to ensure there is no synchronization conflict when executing the automation.
  • An alternative is using a platform like Airtable that supports a native 'get table record by field' block.

 

Prerequisites

  • In the shared example below and attached export, we use a Qlik Sense straight table as source data set. You can obviously also use any other supported clouds system, native file storage sytem or external source through the Call url block.
    • In the below example we used the claims table  from the QlikSense demo project ‘Insurance claims’ (https://demos.qlik.com/)
  • You’ll need a Microsoft Excel file in a OneDrive folder and one table with required headers where the data will be synced to:

    Excel Sheet Example.png

 

 

The Automation

 the automation.png

  1. We apply a selection on our QlikSense sheet and retrieve the data we want to sync to the Excel worksheet. Please note that there is a limit of 100 000 records that can be retrieved through the ‘Get Straight table’ block. 

  2. Use a variable of type ‘list’ to create the rows, selecting the data you want in the correct sequence. Note that you’ll need to add the exact number of columns from the Excel table. You can add blanks for columns you do not want to update. A consequence of this behavior is that you cannot make cells blank.

    variable row.png

  3. In this upsert pattern, we create a row for new records and update existing data. We’ll use the first field (Claim Id) as unique identifier.
    1. Find row in excel worksheet table: will check the unique identifier is found in the list and if so return the row index. If not found the index -1 is returned.
    2. Condition checking the index returned to decide if we need to create or update
    3. Add row to table: specifying the row variable
    4. Update row to table: specifying the row variable and the index

      Update Row Table.png

  4. Optionally we’ve added some output blocks to support debugging purposes - indicating if record has been found or not and which index was used for the upsert pattern. 

    output.png

 

 

Additional notes

  1. Workbook session: it is advised to use a specific session for performance and synchronization conflict reasons.
    • We noticed during our tests that it can take up several seconds before a change in the webinterface of Excel online is picked up by the automation blocks (API).
    • To work inside one session, you can start your automation with ‘create workbook session’ block, add that session-id in all subsequent blocks, and end with the ‘close workbook session’ block.
  2. To save backups of previous versions, you can easily write the data to another sheet before starting this upsert pattern: 

    add table row automation.png

 

 

Tags (1)
Labels (2)
Comments
mck-mthomas
Contributor II
Contributor II

@PietMichielRappelet I am confused, the automation is to push straight table data out to excel; however, I have a table built within the app I am targeting. This automation seems to make me select each field within the data sets of the application, not the field within the table I already created?

Am I using the wrong automation template if I just want to sync my table data to an excel sheet?

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @mck-mthomas 

Please drop your question and needs over in our active Qlik Application Automation forum. We have support agents monitoring this forum to help - as well as a lot of active users of Qlik Application Automation!

All the best,
Sonja 

mck-mthomas
Contributor II
Contributor II

@Sonja_Bauernfeind how do I move this comment, or do I just add as a new over in that forum? It was really a question about these specific instructions, not sure dropping  a new comment without the context of the above is going to make sense to anybody?

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @mck-mthomas 

Let me see if I can get you an answer to this, I'll get back to you soon as I can.

Otherwise, though: asking the question with a reference to the article is perfectly valid.

All the best,
Sonja 

AfeefaTk
Support
Support

Hi @mck-mthomas 

Could you please let me know which template are you using among these two?

  1. Copy and update data from a Qlik Sense straight table to an Excel sheet -> In this template straight table data is exported to an existing table of the Excel sheet.
  2. Copy data from a Qlik Sense straight table to an Excel sheet -> This will create a new Excel sheet and table within the Excel sheet to which the straight table data is exported. More info can be found here

Also, could you please explain a bit more about the use case?

Thanks

 

Version history
Last update:
‎2023-02-09 10:39 AM
Updated by: