Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do i find missing Fields?

Hi Folks,

I'm getting data from Excel like following and after every two days excel will replaced by new same excel same table. But for checkpoint purpose I'll find that whether I'm getting new fields in new data or some fields are missing as compared to old table.

Data:

LOAD

     Date,

     Source_No,

     EMP_ID,

     CountryID,

     Level

FROM

[$(vSource_Data)\Data*.csv]

(txt, codepage is 1235, embedded labels, delimiter is ',', msq);

How do I catch the difference?

AND if the table is same as compared to old one i'll move this source Excel on another location.

Will appreciate help !!

13 Replies
Not applicable
Author

We can check with previously loaded table. following table is the original table which I have already loaded in Qlikview. new excel has to be same as like previous one. but sometime columns may get changed. in that case I need these check points

Data:

LOAD

     Date,

     Source_No,

     EMP_ID,

     CountryID,

     Level

FROM

[$(vSource_Data)\Data*.csv]

(txt, codepage is 1235, embedded labels, delimiter is ',', msq);

balar025
Creator III
Creator III

You can use above script and scripterrormode variable at time and have list of mismatch in other table with tablename.

Let vTableName = TableName(0);

Let vNoOfColumns = NoOfFields('$(vTableName)');

Trace $(vTableName);

Let vFieldList = '';


for i = 1 to $(vNoOfColumns)

vFieldList = vFieldList&','&chr(39)&FieldName($(i),'$(vTableName)')&chr(39);

next i;

vFieldList = right((vFieldList),len(vFieldList)-1);

Trace $(vFieldList);

for i = 1 to $(vNoOfTable)-1

Let vTableName = TableName($(i));

Let vNoOfColumns = NoOfFields('$(vTableName)');

Trace $(vNoOfColumns);

for j=1 to $(vNoOfColumns)

vFieldName =  FieldName($(j),'$(vTableName)');

vFieldCheck = WildMatch('$(vFieldName)',$(vFieldList));

if $(vFieldCheck) = 0 then

Load

'$(vFieldName)' as MisMatch_Field,

'$(vTableName)' as MisMatch_TABLE_NAME

AutoGenerate(1);

ENDIF

Trace $(vTableName) -> $(vFieldName);

next j;

next i;

Not applicable
Author

I see your format is correct and logical

How can I store information in .txt format for mismatch fields in certain table in above code?

can you just tell me where I need to modify ?

balar025
Creator III
Creator III

You just need to store Table into txt as below.

Give table name

MisMatch:

Load

'$(vFieldName)' as MisMatch_Field,

'$(vTableName)' as MisMatch_TABLE_NAME

AutoGenerate(1);

and last statement after next i;

Store MisMatch into MisMatch.txt(txt);

Let me know in case of any issue.