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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Validate the header and footer in positional file

Hello All,
I have positional based input file and need to do validation on the header and footer.
Name     salary      date
abc         5000      01/12/2016     

def         6000      01/12/2016
hij          7000      01/12/2016

klm         8000     01/12/2016
4            26000
Header Validation : First column name should be name and second column name should be salary. In case of mismatch the file should not be processed and job should get failed. In case header validation success it has to process all the records.
Footer Validation: it should have the no of rows processed and total amount of the salary. Could you please someone guide me?
it is critical. Please do help ASAP.
thanks a lot

Labels (2)
4 Replies
Anonymous
Not applicable
Author

I would read the first line with the schema of the positional file (except changing all columns to String type) and check them against the expected column names. Or you save the header line as row in your job and read the header line from the job also as one line and compare directly both Strings. 
Anonymous
Not applicable
Author

I am using tFileInputPositional to read the first record(by setting the limit to 1) and passing the row tJavaRow. In the tJavaRow I am validating like input_row.name.equals("Name") and input_row.salary.equals("Salary"). But I don't know how to call another job to process body of the file if above conditions returns true. Could you please guide me on this? Some simple design would be great help. thanks much
Anonymous
Not applicable
Author

First sub job checks the structure and the second subjob reads the data
tFileInputPositional -> tJavaRow (for checks and in case of errors throw an Exception)
OnSubjobOk
tFileInputPositional ->  .....
Anonymous
Not applicable
Author

thank you so much. it works.