Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
mugdhaojha
Contributor II
Contributor II

Update a field in main transaction table from an excel sheet

Hi,

I have a requirement where I need to populate region name in the Main table if it is blank in the source database from an excel sheet(Region Master) based on the RequestID else the Region should come from source database only.

How can this be done efficiently?The Main table contains more than 10K records.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

MAP:

MAPPING LOAD RequestID, Region FROM EXCEL.xls;

MAIN:

LOAD RequestID,

          if(len(trim(Region))=0,ApplyMap('MAP', RequestID,'No Region found'), Region) as Region,

     ....

FROM MAIN;

View solution in original post

3 Replies
Not applicable

are you wanting to update the value in the source database or in the QlikView application

it sounds like the value will be based on Region master file if it is null?

swuehl
MVP
MVP

MAP:

MAPPING LOAD RequestID, Region FROM EXCEL.xls;

MAIN:

LOAD RequestID,

          if(len(trim(Region))=0,ApplyMap('MAP', RequestID,'No Region found'), Region) as Region,

     ....

FROM MAIN;

Not applicable

yes , we can effectively handle such situation by using mapping table  . in your case you can create your excel workbook as mapping table which will map the  Region value to target table (main table) .

Source_Map:

Mapping load

RequestID,

Region

From .. Excel workbook

Noconcatenate

Main_Table:

Load

.

.

.

RequestID,

ALT(Region , ApplyMap('Source_Map',RequestID,Null()) As Region

.

.

From Source Database .Table