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

Repeating of values

Hi all,

I am new in Qlikview. I have multiple excel file to load and all excel files are same as like below:

Country
S.NO.
Name
America1John
2Emmy
3Michael
Canada1Sara
2Emma
3Marry
4Jack
5Rose

and i want that after loading all the files i want this transformation of data in qlikview which is below:

CountryS.NO.Name
America1John
America2Emmy
America3Michael
Canada1Sara
Canada

2

Emma
Canada3Marry
Canada4Jack
Canada5Rose

Kindly Help me out as soon as possible that who can i transform data as above while i perform loading.

Thanks in advance

1 Solution

Accepted Solutions
sadickbasha
Partner - Contributor III
Partner - Contributor III

Yes, as sokkom mentioned the Peek() will resolve. here is the simplified code

LOAD
if(len(Country)=0,Peek(Country),Country) as Country,
S.NO.,

 
Name;

 
LOAD Country,

    
S.NO.,

    
Name
FROM

C:\Users\260658\Desktop\test2.xlsx

(
ooxml, embedded labels, table is Sheet9);

View solution in original post

4 Replies
Not applicable
Author

Anyone please answer it

Sokkorn
Master
Master

Hi Syed,

Using Peek() function should do this job. Here is an example:

[Data]:

LOAD * Inline [

Country, SO, Name

America, 1, John

  , 2, Emmy

  , 3, Michael

Canada, 1, Sara

,2, Emma

,3, Marry

,4, Jack

,5, Rose];

[Data2]:

LOAD

  Country AS Country1,

If(Len(Country)=0,Peek(Country2),Country) AS [Country2],

  SO AS SO1,

  Name AS Name1

Resident [Data];

Regards,

Sokkorn

sadickbasha
Partner - Contributor III
Partner - Contributor III

Yes, as sokkom mentioned the Peek() will resolve. here is the simplified code

LOAD
if(len(Country)=0,Peek(Country),Country) as Country,
S.NO.,

 
Name;

 
LOAD Country,

    
S.NO.,

    
Name
FROM

C:\Users\260658\Desktop\test2.xlsx

(
ooxml, embedded labels, table is Sheet9);

Not applicable
Author

Thanks So much guys it works.. I am so kind of u..