Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Swarup_MOA
Contributor III
Contributor III

Convert all the excels in a folder to qvds

Need a recursively convert excels to qvds 

Labels (1)
3 Replies
swarup_malli
Specialist
Specialist

// Step 1: Set the main folder path
SET vMainFolderPath = 'C:\Your\Folder\Path\';

// Step 2: Load and process Excel files
FOR EACH FileExtension in 'xlsx', 'xls'
FOR EACH FoundFile in FileList('$(vMainFolderPath)\*.$(FileExtension)')
LOAD *
FROM $(FoundFile)
(ooxml, embedded labels, table is [Sheet1]);

// Step 3: Convert and store the data as QVD
LET vQvdFileName = Replace(Replace('$(FoundFile)', '.xlsx', '.qvd'), '.xls', '.qvd');
STORE * INTO $(vQvdFileName) (QVD);
NEXT
NEXT

Swarup_MOA
Contributor III
Contributor III
Author

this worked for me

 

FOR EACH file in filelist('$(vSourceQvd)\*.xlsx') ;
TRACE '$(file )';
tmp:
LOAD *
FROM $(file)
(ooxml, embedded labels, table is Sheet1);

let QVDPath = left('$(file)', len('$(file)')-4) & 'qvd';

Store * from tmp into '$(QVDPath)' (qvd);
drop Table tmp;

NEXT file

 

swarup_malli
Specialist
Specialist

sum({<Employment_Date_Master={"$(vMaxSelectedEmploymentDate)"}>*
<MONEY_SOURCE={'A'},[Employment Date]={"<=$(vEmployeeDateMax)"},REHIRE_DT={" "}> *
(<MONEY_SOURCE={'A'},TERM_DT={">=$(vEmployeeDateMin)"}>+<TERM_DT={" "}>)
+
((<MONEY_SOURCE={'A'},REHIRE_DT={"<=$(vEmployeeDateMax)"},Termination_DT-={" "}>)
*
(<MONEY_SOURCE={'A'},REHIRE_DT-={" "}>))
} PART_MARKET_VALUE)