Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Script

I Have a table  in the following format:

FirstName,LastName , Address,SSN

I want to take a resident of the above table and get the data only where SSN is maximum??????

Please help

1 Solution

Accepted Solutions
Not applicable

Re: Script

Hi,

tempTable:
LOAD * INLINE [
    FirstName, LastName, Address, SSN
    a, a, a, 1
    b, b, b, 2
    c, c, c, 3
    d, d, d, 3
];

tempTable1: //This table loads only one entry with max SSN
First 1 Load
FirstName as tempFirstName,
LastName as tempLastName,
Address as tempAddress,
SSN as tempSSN
Resident tempTable order by SSN desc;

LET maxSSN=FieldValue('tempSSN',1); //Getting the maxSSN

finalTable:
NoConcatenate  //Make sure it does not concatenate with tempTable
Load *
resident tempTable where SSN=$(maxSSN);

Drop table tempTable;
Drop table tempTable1;

Is that what you are looking for?

Regards,

Xue Bin

2 Replies
Not applicable

Re: Script

Hi,

tempTable:
LOAD * INLINE [
    FirstName, LastName, Address, SSN
    a, a, a, 1
    b, b, b, 2
    c, c, c, 3
    d, d, d, 3
];

tempTable1: //This table loads only one entry with max SSN
First 1 Load
FirstName as tempFirstName,
LastName as tempLastName,
Address as tempAddress,
SSN as tempSSN
Resident tempTable order by SSN desc;

LET maxSSN=FieldValue('tempSSN',1); //Getting the maxSSN

finalTable:
NoConcatenate  //Make sure it does not concatenate with tempTable
Load *
resident tempTable where SSN=$(maxSSN);

Drop table tempTable;
Drop table tempTable1;

Is that what you are looking for?

Regards,

Xue Bin

Not applicable

Re: Script

Hi

thanks a lot

Community Browser