Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

set analysis

Hi ,

my data looks like this

date                    price

1/02/2010              100

5/10/2010               500

6/01/2011               50

7/09/2011               300

8/02/2012              400

7/05/2012              600

Now i want output as

Maxdate             Latestprice

7/05/2012             600

because among all dates 7/05/2012 is the maximum date and 600 is the corresponding price.

But if select any year (eg:2010)

output must be

Maxdate             Latestprice

5/10/2010              500

. the latest price must show me the coresponding value of date(maxdate).

1 Solution

Accepted Solutions
Not applicable
Author

Hi Avi,

     You have to use Set Analysis to get the Price for the Max(Date) in your selection. For example, like this:

     Max({<Date={'$(=Max(Date))'}>} Price)

I have attached a document with an example.

Juan Gerardo

View solution in original post

4 Replies
Not applicable
Author

Hi Avi,

     You have to use Set Analysis to get the Price for the Max(Date) in your selection. For example, like this:

     Max({<Date={'$(=Max(Date))'}>} Price)

I have attached a document with an example.

Juan Gerardo

Not applicable
Author

Hi Avinash,

  Please Find the Attached File. Hope this helpful for you

Regards,

Nirmal.

Not applicable
Author

Hi Avi,

Above Mentioned both answers are working fine

regards,

Ananth

Not applicable
Author

HI

FOR THIS OUTPUT--

maxDatepricenew
7/5/2012600

WRITE CODE-

LOAD

date(max(date))as maxDate,

FirstSortedValue(price,-date)as pricenew;

LOAD date,

     price

FROM

(ooxml, embedded labels, table is Sheet1);

**************************************************************

FOR THIS OUTPUT, WRITECODE--