Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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];
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,
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!
still doesn't work, will be because the table 'Ventas2' is not inline?
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,
Hi Santiago, [Sum de Txs Tot Cre] and [Suma de Txs Tot Cre] was a transalate mistake
I attached the model, thanks
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.
sorry, was a qlik sense app
now I attached the app in qlik view
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,
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