Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I have a pivot table with 8764 lines of records.
I need to split into sub files with 900 lines of records each.
Is it possible?
pls give suggestions
Hi Rajendran,
Check below script, it is working
Data:
LOAD
RowNo() AS RowNum,
*
FROM DataSource;
LET vRowsPerFile = 900;
LET vRowCount =NoOfRows('Data');
LET vNoOfPages = Ceil(vRowCount/vRowsPerFile);
LET vRowStartNum = 1;
For Index = 1 to vNoOfPages
LET vRowEndNum = vRowsPerFile * Index;
Temp:
NoConcatenate
LOAD
*
RESIDENT Data
WHERE RowNum >= $(vRowStartNum) AND RowNum <=$(vRowEndNum);
STORE Temp INTO File$(Index).qvd;
DROP TABLE Temp;
LET vRowStartNum = vRowEndNum + 1;
NEXT Index;
You can do. What is the purpose of spiting the files ?
In Qlikview 8764 rows is not a bad.
hi dathu,
the requirement is like that.
Each file should have only 900 lines and the file has to be sent thro NPrinting.
pls help me to do this
hi,
Please try to use filters in calculated dimension or expressions to split records as per your requirement.
Regards
Neetha
is it possible in the script?
i cant use calculated dimensions.
i need to split from the table
hi
Please Check if this helps:
How to Create Reports Based on QlikView Entities – Customer Feedback for Vizubi
thanks for the response.
but give some suggestions to do in script itself.
is it possible to split one table to several tables with 900 lines.
i.e., my table has 8764 lines, then i need to split into 10 files.
is it possible?
by using filter like rowno?
pls help
Do you have only one table in your data model ?
Is pivot table creating from one table fields ?
Add the Newfield to your dimension table have 8374 records called Bucket with below expression:
Ceil(RowNo()/900) AS Bucket.
So Bucket have 1 , 2 3, etc for each 900 rows in the table. So you can simply create your own no of Pivvot tables based on that.
Hi,
In script try like this
Data:
LOAD
RowNo() AS RowNum,
*
FROM DataSource;
LET vRowCount =NoOfRows('Data');
LET vNoOfPages = Ceil(vRowCount)/900;
LET vRowStartNum = 1;
For Index = 1 to vNoOfPages
LET vRowEndNum = vNoOfPages * Index;
Temp:
NoConcatenate
LOAD
*
RESIDENT Data
WHERE RowNum >= $(vRowStartNum) AND RowNum <=$(vRowEndNum);
STORE Temp INTO File$(Index).qvd;
DROP TABLE Temp;
LET vRowStartNum = vRowStartNum + vRowEndNum ;
NEXT Index;
After executing this script, a separate QVD is created for every 900 rows in your data.
Hope this helps you.
Regards,
Jagan.
hi,
instead of splitting data for 900 records each ,split by months or years and store in qvds.
this way maintenance wise its easier.
Regards
Neetha