Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
arngue
Contributor III
Contributor III

ApplyMap not working as expected

Hi Guys,

Anyone can explain me why this code isn't working, it's getting me map_id not found error.

LET vL.TableName = 'Notas_Tramites_Tareas';
LET vL.FromQvdName = 'TTN';
LET vL.StoreQvdName = 'Notas_Tramites_Tareas';
LET vL.before = Now();

TTN_TIP:
Mapping Load * Inline [
TTN_TIP, val
A, Automatica
M, Manual
];

$(vL.TableName):
LOAD
"TTN_ID" as [ID_Nota],
"TTN_TRT" as [ID_TramiteTarea],
"TTN_USC" as [ID_Usuario_Creador],
"TTN_FEC" as [Fecha],
"TTN_TIT" as [Nota],
"TTN_DES" as [Descripcion],
ApplyMap("TTN_TIP", TTN_TIP) as [Tipo],
"TTN_TIP" as [Codigo Tipo]
From $(vL.From_QVD_PATH)/$(vL.From_Layer)/$(vL.FromQvdName).qvd(qvd);

Store $(vL.TableName) into $(vL.Store_QVD_PATH)/$(vL.Store_Layer)/$(vL.StoreQvdName).qvd (qvd);

LET vL.after = Now();
LET vL.TableNumber = $(vL.TableNumber) + 1;
LET vL.TableName_$(vL.TableNumber) = '$(vL.TableName)';
LET vL.NoOfRows_$(vL.TableNumber) = NoOfRows('$(vL.TableName)');
LET vL.NoOfFields_$(vL.TableNumber) = NoOfFields('$(vL.TableName)');
LET vL.TableTime_$(vL.TableNumber) = Interval(Timestamp('$(vL.after)') - timestamp('$(vL.before)'),'hh:mm:ss');

Drop table $(vL.TableName);

 

I use other ApplyMaps in prevoius files, could be a number maximum of mapped tables? is there a way to drop thoose?

Labels (2)
1 Solution

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

Hi @arngue ,

Maybe you have to use single quote with ApplyMap ex.  ApplyMap('TTN_TIP', TTN_TIP) as [Tipo]

Best Regards
Andrea

 

View solution in original post

3 Replies
agigliotti
Partner - Champion
Partner - Champion

Hi @arngue ,

Maybe you have to use single quote with ApplyMap ex.  ApplyMap('TTN_TIP', TTN_TIP) as [Tipo]

Best Regards
Andrea

 

MayilVahanan

Hi @arngue 

ApplyMap('TTN_TIP', TTN_TIP)

<-- Applymap will use table name with single quotes. "Double Quotes" indicates the field Name.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
arngue
Contributor III
Contributor III
Author

I dunno why this happens only sometimes