Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Folks,
Thanks in advance.
How I create a loop to check whether I'm getting right table structure or not?
In one folder on server 'E:\Data\..' i get 3 excel file which moved in 'D:\Data\..' by batch files. from 'D:\Data\..' Qlikview starts to fetch data.
but before moving in 'D:\Data\ i want check the structure of files. so how can i write script to check structure?
Emp:
Source:
Period:
You can read the XML metadata of the QVD file to check field existance such as this example
QvdFieldHeader: LOAD FieldName FROM F:\YOURPATH\Emp.qvd (XmlSimple, Table is [QvdTableHeader/Fields/QvdFieldHeader]); For i = 0 to NoOfRows('QvdFieldHeader')-1 LET vFieldName = peek('FieldName', $(i)); if FieldIndex('FieldName',peek('FieldName', $(i))) > 0 then Trace 'Field ' & '$(vFieldName)' & ' exists'; LET vStructureOK = true(); else Trace 'Field ' & '$(vFieldName)' & ' is missing'; LET vStructureOK = false(); end if; next if $(vStructureOK) = true() Then //Load from QVD ELSE //.... END IF //cleanup LET vFieldName =; LET vStructureOK =; EXIT Script;