As i read the article about, its very clear to me that i need a common field in both tables, and its not the case.
Right? So how can i input Nome_Arquivo into TMP?
Other thing, to make clear that i understand this function.
ApplyMap('ADICIONA_NOME', field from table TMP, null()) AS Id_Hotel
It will check in 'ADICIONA_NOME' the field from table TMP (first parameter), and return if match Nome_Arquivo (second parameter) with a name that i choose.
And thank you for your time
You don't need a common field name to link your mapping table with the table you are loading using the ApplyMap().
In fact, a mapping table is only a temporary table, it's just a table to lookup values for a given key (key - value pairs).
You can query the value by given the key as second argument in ApplyMap() function.
I rather think your problem is something different:
Are you sure this is correct?
Have you tried to load the table without the MAPPING prefix and checked that the key - value pairs are loaded correctly?
edit: As often, it's much easier to help you if you could provide a simplified data sample.
Hi Stefan !
I'll try to answer you:
1)Are you sure this is correct?
Yes, because each TMP refers to one Name in LISTA_ARQUIVOS.
LISTA_ARQUIVOS is like a list of names and TMP a list with adress, phone,city etc. So i need related 1:1
2)Have you tried to load the table without the MAPPING prefix and checked that the key - value pairs are loaded correctly?
Yes. it runs with no problem
3)edit: As often, it's much easier to help you if you could provide a simplified data sample.
You mean attach the qvd with data or share a image of output?
And i did a workaround, it works but i feel that is not the right way to do. See the code below please
for a=1 to vInicio
Let vEndereco = FieldValue('Endereco_Arquivo',$(a));
Let vArquivo= subfield(vEndereco, '\', 4);
"Postos horários" AS PICO,
("kWh fornecido") AS CONSUMO,
ApplyMap('ADICIONA_NOME', Data,'$(vArquivo)') as Id_Hotel
WHERE YEAR(Data) = $(vAno) AND MONTH(Data)=$(vMes);
It works, but im not happy with this code.
Data_Example.zip 131.7 K