Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
shair_abbas
Partner - Creator
Partner - Creator

Latest Date Issue

Hello every one:
            I need some help,I have following table
ProductID      Price        date

1                    20           01/12/2013

1                    30           01/12/2014

1                    40            25/03/2015

2                    10            01/01/2014

2                    20            01/01/2015

I only want to load that productId,Price and date which are latest like

productID         Price            Date

1                       40               25/03/2015

2                       20               01/01/2015

Kindly help me out.

Thanks,

1 Solution

Accepted Solutions
maxgro
MVP
MVP

another one

xyz:

load * inline [

ProductID  ,    Price   ,     date

1    ,                20   ,        01/12/2013

1    ,                30 ,          01/12/2014

1    ,                40 ,           25/03/2015

2    ,                10 ,           01/01/2014

2    ,                20,            01/01/2015

];

Right Keep (xyz)

LOAD

     ProductID,

     Max( date ) AS date

Resident

  xyz

GROUP

     BY ProductID;

View solution in original post

3 Replies
petter
Partner - Champion III
Partner - Champion III

LOAD

     productID,

     Only( Price ) AS Price,

     Max( Date ) AS Date

FROM

     PriceList.xlsx (ooxml .... )

GROUP

     BY productID;

MK_QSL
MVP
MVP

Front End

Create a Straight Table

Dimension

productID

Expressions

FirstSortedValue(SUM(Price),-Date)

FirstSortedValue(Date,-Date)

maxgro
MVP
MVP

another one

xyz:

load * inline [

ProductID  ,    Price   ,     date

1    ,                20   ,        01/12/2013

1    ,                30 ,          01/12/2014

1    ,                40 ,           25/03/2015

2    ,                10 ,           01/01/2014

2    ,                20,            01/01/2015

];

Right Keep (xyz)

LOAD

     ProductID,

     Max( date ) AS date

Resident

  xyz

GROUP

     BY ProductID;