Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

satishkamath
Contributor II

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

Re: How do I split records

You could try it with:

...

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

store ...

- Marcus

micheledenardi
Valued Contributor

Re: How do I split records

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;

satishkamath
Contributor II

Re: How do I split records

Hi Michele/ Marcus

Your suggestion is helpful,

Thanks

micheledenardi
Valued Contributor

Re: How do I split records

Hi Satish,

please mark as correct your favourite solution.