Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Locate missing values automatically after recharging

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

1 Reply
anlonghi2
Creator II
Creator II

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