Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
j_vergaraolguin
New Contributor II

Campo no encontrado al usar mapping/applymap

Hello, I have a table that is loaded using mapping, the problem is that by using the fields in another table tells me that [Sum of Txs Tot Cre] was not found, what am I doing wrong?

Ventas2:

mapping LOAD

[Suma de Vta Tot Cre],

  [Suma de Txs Tot Cre]

  Resident [Ventas];

//-----------------------------------------------------------------------------------------------

[Tablas]:

LOAD

[Cat Tar Cred],

  replace([Venta Min],'.',',') as [Venta Min],

  [Venta Max],

  replace([Vale Min],'.',',') as [Vale Min],

  replace([Vale Max],'.',',') as [Vale Max],

  replace([Tasa],'.',',') as [Tasa],

    ApplyMap('Ventas2',[Suma de Txs Tot Cre]),

    sum([Suma de Txs Tot Cre]) as SumTSX2,

    ApplyMap('Ventas2',[Suma de Vta Tot Cre]),

  [Suma de Vta Tot Cre]/[Suma de Txs Tot Cre] as VarVtaTxs,

if([Venta Min]<=SumTSX2, Tasa,'-') as Prueba00,

if([Venta Max]<=SumTSX2, Tasa,'-') as Prueba01,

if([Vale Min]<=VarVtaTxs, Tasa,'-') as Prueba10,

if([Vale Max]<=VarVtaTxs, Tasa,'-') as Prueba11

FROM [lib://Transbank/Sabana.xlsx]

(ooxml, embedded labels, table is Tablas);

group by [Cat Tar Cred],[Venta Min],[Venta Max],[Vale Min],[Vale Max],[Tasa],

[Suma de Txs Tot Cre], [Suma de Vta Tot Cre];

9 Replies
arulsettu
Honored Contributor III

Re: Campo no encontrado al usar mapping/applymap

try giving some name

ApplyMap('Ventas2',[Suma de Txs Tot Cre]) as somename,

    sum([Suma de Txs Tot Cre]) as SumTSX2,

    ApplyMap('Ventas2',[Suma de Vta Tot Cre]) as as somename,

javiermillas
New Contributor II

Re: Campo no encontrado al usar mapping/applymap

Hi,

I had a similar issue some days ago, and the problem was that I was missing the line "Data: " before the LOAD instruction. Your code should look:

Data:

LOAD

[Cat Tar Cred],


Good luck!

j_vergaraolguin
New Contributor II

Re: Campo no encontrado al usar mapping/applymap

still doesn't work, will be because the table 'Ventas2' is not inline?

santiago_respane
Valued Contributor

Re: Campo no encontrado al usar mapping/applymap

Hi, can you share a sample app with dummy data?

In your syntax there are some small issues:

-in your from you have a ';' before your group by

-Also you mention that your error is [Sum of Txs Tot Cre] was not found and in your load statement you are using [Suma de Txs Tot Cre]

With a sample app it will be easier to help you.

Kind regards,

j_vergaraolguin
New Contributor II

Re: Campo no encontrado al usar mapping/applymap

Hi Santiago, [Sum de Txs Tot Cre] and [Suma de Txs Tot Cre] was a transalate mistake

I attached the model,  thanks

santiago_respane
Valued Contributor

Re: Campo no encontrado al usar mapping/applymap

Hi Joaquin,

it seems the file you posted is in a newer version of QV or i cannot open it, no prob.

As i can see you are creating a mapping that uses numbers as source and destination, you should verify that those numbers match and they have both same value and format.

You can try adding the third parameter to know when there's no match

ApplyMap('Ventas2',[Suma de Txs Tot Cre],'NO MATCH')


Also verify that the field you are using in the applymap must exists in your file [lib://Transbank/Sabana.xlsx]

Check the below example:

map1:

mapping load * inline [

x, y

1, one

2, two

3, three ] ;

TableFinal:

LOAD

     f1,

     f2,

     f3,

     ApplyMap('Map1',f4,'No Match') as f4Mapped

FROM [PathToMyFile] (ooxml, embedded labels, table is Tablas);

Hope this helps.

j_vergaraolguin
New Contributor II

Re: Campo no encontrado al usar mapping/applymap

sorry, was a qlik sense app

now I attached the app in qlik view

santiago_respane
Valued Contributor

Re: Campo no encontrado al usar mapping/applymap

Hi Joaquin,

please explain what do you want to achieve with your applymap, not by code but the result you want to obtain.

Kind regards,

j_vergaraolguin
New Contributor II

Re: Campo no encontrado al usar mapping/applymap

I need calculate this in the script

i dont know if is the best solution, I tried to resolve this whith

joins between the tables, but the results are wrong data

if([Venta Min]<=SumTSX2, Tasa,'-') as Prueba00,

if([Venta Max]<=SumTSX2, Tasa,'-') as Prueba01,

if([Vale Min]<=VarVtaTxs, Tasa,'-') as Prueba10,

if([Vale Max]<=VarVtaTxs, Tasa,'-') as Prueba11

sorry for my english