Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Chanty4u
MVP
MVP

RE: Insert Empty

Hi all,

I have some excel data and i want to load that data into qlikview.

so my requirment is that.

i want to load all the data  and load   10 empty rows   shud be load   after 25th  record.?

is it possible?

Thanks in advance.

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Check this

Temp:

LOAD RowNo() AS ID

FROM

[EmpOff.xls]

(biff, embedded labels, table is Employee$);

LET vTotalRows = NoOfRows('Temp');

LET vNoofIterations = Ceil(vTotalRows/25);

LET vStartRow = 0;

LET vRowsHandler = 25;

DROP TABLE Temp;

FOR Index = 1 TO vNoofIterations

LET vRowCount = vStartRow + ((Index - 1) * 10);

Data:

LOAD ($(vRowCount) +  RowNo()) AS ID,

  EmpID,

     [Last Name],

     [First Name],

     Title,

     [Hire Date],

     Office,

     Extension,

     [Reports To],

     [Year Salary]

FROM

[EmpOff.xls]

(biff, embedded labels, table is Employee$)

WHERE RecNo() > $(vStartRow) AND  RecNo() <= $(vRowsHandler);

LET vRowCount = vRowCount  + 25;

Concatenate(Data)

LOAD

  ($(vRowCount) +  RowNo()) AS ID,

' ' AS EmpID,

' ' AS [Last Name],

' ' AS [First Name],

' ' AS Title,

' ' AS [Hire Date],

' ' AS Office,

' ' AS Extension,

' ' AS [Reports To],

' ' AS [Year Salary]

AutoGenerate(10);

LET vRowsHandler = vRowsHandler + 25;

LET vStartRow = vStartRow + 25;

NEXT

View solution in original post

17 Replies
Digvijay_Singh

Not sure why you want to do it, check this below -

T1:

First 24

LOAD

  EmpID,

     [Last Name],

     [First Name],

     Title,

     [Hire Date],

     Office,

     Extension,

     [Reports To],

     [Year Salary]

FROM

EmpOff.xls

(biff, embedded labels, table is Employee$);

Concatenate

Load ' ' as A

AutoGenerate(10);

Concatenate

LOAD EmpID,

     [Last Name],

     [First Name],

     Title,

     [Hire Date],

     Office,

     Extension,

     [Reports To],

     [Year Salary]

FROM

EmpOff.xls

(biff, embedded labels, table is Employee$)

Where not exists(EmpID);

Drop field A;

Digvijay_Singh

should be 'First 25' in the first script, just re-checked requirement.

settu_periasamy
Master III
Master III

Hi,

May be try

Directory;
T1:
LOAD EmpID,
[Last Name],
[First Name],
Title,
[Hire Date],
Office,
Extension,
[Reports To],
[Year Salary]
FROM
[EmpOff (1).xls]
(
biff, embedded labels, table is Employee$) Where RecNo()<=25;

Concatenate
LOAD '' as Temp AutoGenerate 10;

Concatenate(T1)
LOAD EmpID,
[Last Name],
[First Name],
Title,
[Hire Date],
Office,
Extension,
[Reports To],
[Year Salary]
FROM
[EmpOff (1).xls]
(
biff, embedded labels, table is Employee$) Where RecNo()>25;


NoConcatenate
Final:
LOAD *,RecNo() as Rec Resident T1;

DROP Table T1;
DROP Field Temp;

tresesco
MVP
MVP

Try like:

LOAD If(RowNo()>25, RowNo()+10, RowNo()) as RowNum,

  EmpID,

    [Last Name],

    [First Name],

    Title,

    [Hire Date],

    Office,

    Extension,

    [Reports To],

    [Year Salary]

FROM

(biff, embedded labels, table is Employee$);

Load

  RecNo()+25 as RowNum,

  '' as EmpID,

    '' as [Last Name],

    '' as [First Name],

    '' as Title,

    '' as [Hire Date],

    '' as Office,

    '' as Extension,

    '' as [Reports To],

    '' as [Year Salary]

AutoGenerate 10;  

Untitled.png

jonathandienst
Partner - Champion III
Partner - Champion III

I am curious as to  why you want to do this...

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Data:

LOAD RowNo() AS ID,

  EmpID,

     [Last Name],

     [First Name],

     Title,

     [Hire Date],

     Office,

     Extension,

     [Reports To],

     [Year Salary]

FROM

[EmpOff.xls]

(biff, embedded labels, table is Employee$)

WHERE RecNo() <= 25;

Concatenate(Data)

LOAD

  25 + RecNo() AS ID,

' ' AS EmpID,

' ' AS [Last Name],

' ' AS [First Name],

' ' AS Title,

' ' AS [Hire Date],

' ' AS Office,

' ' AS Extension,

' ' AS [Reports To],

' ' AS [Year Salary]

AutoGenerate(10);

Concatenate(Data)

LOAD 35 + RecNo() AS ID,

  EmpID,

     [Last Name],

     [First Name],

     Title,

     [Hire Date],

     Office,

     Extension,

     [Reports To],

     [Year Salary]

FROM

[EmpOff.xls]

(biff, embedded labels, table is Employee$)

WHERE RecNo() > 25;

Regards,

Jagan.

Chanty4u
MVP
MVP
Author

thnks for all...evry one correct.

but my user want  for every  25th record will hve 10 empty rows?

i mean  25 rows

then 10 empty rows

then

60 th rec

then 10 empty rec?

how can i do....there is lot of data i hve?

jagan
Luminary Alumni
Luminary Alumni

Hi,

25 & 60 rows are constant?  or in any other place do we need to insert?  For 25 and 60 check below

Data:

LOAD RowNo() AS ID,

  EmpID,

     [Last Name],

     [First Name],

     Title,

     [Hire Date],

     Office,

     Extension,

     [Reports To],

     [Year Salary]

FROM

[EmpOff.xls]

(biff, embedded labels, table is Employee$)

WHERE RecNo() <= 25;

Concatenate(Data)

LOAD

  25 + RecNo() AS ID,

' ' AS EmpID,

' ' AS [Last Name],

' ' AS [First Name],

' ' AS Title,

' ' AS [Hire Date],

' ' AS Office,

' ' AS Extension,

' ' AS [Reports To],

' ' AS [Year Salary]

AutoGenerate(10);

Concatenate(Data)

LOAD 35 + RecNo() AS ID,

  EmpID,

     [Last Name],

     [First Name],

     Title,

     [Hire Date],

     Office,

     Extension,

     [Reports To],

     [Year Salary]

FROM

[EmpOff.xls]

(biff, embedded labels, table is Employee$)

WHERE RecNo() > 25 AND RecNo() <= 60;

Concatenate(Data)

LOAD

  60 + RecNo() AS ID,

' ' AS EmpID,

' ' AS [Last Name],

' ' AS [First Name],

' ' AS Title,

' ' AS [Hire Date],

' ' AS Office,

' ' AS Extension,

' ' AS [Reports To],

' ' AS [Year Salary]

AutoGenerate(10);

Concatenate(Data)

LOAD 35 + RecNo() AS ID,

  EmpID,

     [Last Name],

     [First Name],

     Title,

     [Hire Date],

     Office,

     Extension,

     [Reports To],

     [Year Salary]

FROM

[EmpOff.xls]

(biff, embedded labels, table is Employee$)

WHERE RecNo() > 60;

Regards,

Jagan.

Anonymous
Not applicable

Hi Chanty,

try This

T1:

LOAD EmpID,

     [Last Name],

     [First Name],

     Title,

     [Hire Date],

     Office,

     Extension,

     [Reports To],

     [Year Salary],

     RowNo() as rFlag

FROM

(biff, embedded labels, table is Employee$);

T2:

NoConcatenate Load * Resident T1

Where rFlag<=25;

add Load

   '' as EmpID,

      '' as [Last Name],

      '' as [First Name],

      '' as Title,

      '' as [Hire Date],

      '' as Office,

      '' as Extension,

      '' as [Reports To],

      '' as [Year Salary],

      'A'&RecNo() as  rFlag

      AutoGenerate(10);

T2:

Load

     EmpID,

     [Last Name],

     [First Name],

     Title,

     [Hire Date],

     Office,

     Extension,

     [Reports To],

     [Year Salary],

     'B'&rFlag as rFlag

     Resident T1

Where rFlag>=25;

drop table T1;

Img1.PNG

Hop this will help you....