Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How do I split records

Hi all

How do I split records based on odd and even number of rows.

Simply split row number 1,3,5,7,9.. in one QVD file

and 2,4,6,8, ...in another QVD file

Thanks in advance for your help

4 Replies
marcus_sommer

You could try it with:

...

where mod(recno(), 2) = 0; // respectively 1

store ...

- Marcus

micheledenardi
Specialist II
Specialist II

Create a field "Row" which contain the RowNo() and after that use "where" clause to create the two tables:

Main:

Load

rowno() as Row

AutoGenerate(100);

OddTable:

NoConcatenate

Load

Row as OddRows

Resident Main where odd(Row)=-1;

OddTable:

NoConcatenate

Load

Row as EvenRows

Resident Main where even(Row)=-1;

drop Table Main;

Drop field Row;

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

Hi Michele/ Marcus

Your suggestion is helpful,

Thanks

micheledenardi
Specialist II
Specialist II

Hi Satish,

please mark as correct your favourite solution.

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.