Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
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