Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have several qvw which are reloaded one after the other or in parallel and I try to highlight automatically the presence of the value ' Anomaly mapping ' generated during applymap.
I wish to make it most automatically possible, for example by scanning every qvw of a directory to find this value in the whole of the data. The objective is to locate quickly the anomaly to go back to the mapping in cause and update the data sources before reloading.
Is there an application to make it or a macro?
Beforehand thank you.
Christophe
Hi Christophe,
I don't know how you reload data, but you can try to locate applymap errors using trace so you can log (if you activated logs) and see to the script execution monitor the errors.
eg:
Directory;
CurrencyRate:
mapping LOAD
autonumber(FromCurrency & '|' & MonthName(Date)) as Key_CurrencyMonthYear,
evaluate(Rate) as Rate
FROM
CURRENCY.csv
(txt, codepage is 1252, embedded labels, delimiter is ',', msq) where ToCurrency='USD';
for each vFiles in filelist('CURRENCY_PRS*.csv')
People:
LOAD *,ApplyMap('CurrencyRate',Key_CurrencyMonthYear,'Anomaly mapping' ) as Rate_USD;
LOAD manager,
autonumber(currency_code & '|' & MonthName(date(date#(date,'M/D/YYYY'),'DD/MM/YYYY'))) as Key_CurrencyMonthYear,
sales_amount,
date as Date_Orig,
date(date#(date,'M/D/YYYY'),'DD/MM/YYYY') as date,
currency_code
FROM
[$(vFiles)]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
next
CheckTable:
load
sum(if(Rate_USD='Anomaly mapping',1,0)) as MappingError
resident People group by manager;
Let ExistError=peek('MappingError',-1,'CheckTable');
if $(ExistError)>0 then
trace 'Mapping Error';
end if
You can improve the above script, for example, adding a loop on all the tables of your data model to look for 'Anomaly mapping' and trace the table name where the error occurred.
Let me know
Best regards
Andrea