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

Latest Date Issue

Hi,

I want to load only rows which is having the latest Updation date.

NameNumberAddressUpdation Date
John12US10-Jan-13
John12UK15-Jan-13
Mary14UK10-Jan-13
Wilson15India15-Feb-13
Wilson15UAE18-Feb-13
Martin16UAE15-Feb-13
Mariya17China18-Feb-13

In detail i want to load the Adress of employee based on the latest Updation Date.( For John Adress should be UK)

Thanks in Advance.

1 Solution

Accepted Solutions
Not applicable
Author

load name,

    max(date(updationdate)) as maxdate,

    FirstSortedValue(address,-updationdate) as newaddress

    Group by name;

LOAD name,

     number,

     address,

     updationdate

FROM

(ooxml, embedded labels, table is Sheet1);

then output like this--

namenewaddressmaxdate
maryuk1/10/2013
johnuk1/15/2013
martinuae2/15/2013
mariyachina2/18/2013
wilsonuae2/18/2013

View solution in original post

8 Replies
Not applicable
Author

load name,

    max(date(updationdate)) as maxdate,

    FirstSortedValue(address,-updationdate) as newaddress

    Group by name;

LOAD name,

     number,

     address,

     updationdate

FROM

(ooxml, embedded labels, table is Sheet1);

then output like this--

namenewaddressmaxdate
maryuk1/10/2013
johnuk1/15/2013
martinuae2/15/2013
mariyachina2/18/2013
wilsonuae2/18/2013
Not applicable
Author

HI Yaseen,

Use groub by to achive the result

a:

LOAD * INLINE [

        Name, Number, Address, Updation_Date

    John, 12, US, 10-Jan-13

    John, 12, UK, 15-Jan-13

    Mary, 14, UK, 10-Jan-13

    Wilson, 15, India, 15-Feb-13

    Wilson, 15, UAE, 18-Feb-13

    Martin, 16, UAE, 15-Feb-13

    Mariya, 17, China, 18-Feb-13

];

b:

NoConcatenate

load  Name, Number, Address,date(Date#(trim(Updation_Date),'DD-MMM-YY')) as Updation_Date  Resident a;

c:

LOAD date(max(Updation_Date)) as date,Address,Name Resident b Group by Address,Name;

drop Table a,b;

SunilChauhan
Champion
Champion

In Dimension,

Name ,Number and Updationdate and in

Expression

firstsortedVale(Adress,Updationdate)

Hope this helps

Sunil Chauhan
Not applicable
Author

Thanks a ton Vishwa, its working.

I have doubt plz clear me what is the meaning of "-updationdate" this.

Regards,

yaseen

Not applicable
Author

Hello,

I think we can use FirstSortedValue() in the scripting only not in the charts.

Regards,

yaseen

SunilChauhan
Champion
Champion

Hi,

i think we can use firstsortedvalue in expression.to check type firstsortedValue() in expression.

if it show blue color and popup arguments it means it should use in expression otherwise not.

Hope this helps

Sunil Chauhan
Not applicable
Author

Hello,

I have checked it is not working.

SunilChauhan
Champion
Champion

we can use first sorted value in expressions also

see the example attached

Sunil Chauhan