Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

the most recent date

I have: 'name', 'value' and 'date'

I want to appear only the product with the most recent date, provided that this value is not null

example:

A___565___01/03/09

A___null___19/11/09

A___120___30/02/10

A___null___21/05/10

A___null___06/08/10


in this case would be:

A___120___30/02/10

because the value of this product is different from 'null' and because it is the most recent

can someone help me?

Labels (1)
8 Replies
Not applicable
Author

I think that are a single row "A___120___30/02/10"

You need to use a string function to separete in three fields how you say.

In this case:

NAME: Left('A___120___30/02/10', 1)

VALUE: Right(Left('A___120___30/02/10', 7), 3)

DATE: Right('A___120___30/02/10', 😎

After you can use the IF statement to show your result.

pover
Partner - Master
Partner - Master

There should be a better way, but try a formula like this:

sum({$<value -= {}>} if(date=aggr(nodistinct max(date),name),value))

It doesn't have to be a sum and the set analysis "value -= {}" is to get rid of the null values.

Edit: This formula considers that you have more than one product name and that you want to see the latest date for each product name in a table with the dimensions product name and date.

Regards.

Not applicable
Author

See this example.

Not applicable
Author

did not work
pover
Partner - Master
Partner - Master

Ok, but am I correct that you want a table that shows the value from the lastest date of various products or is Eduardo's solution correct?

Not applicable
Author

I really want it what you said, but he can not get a date whose value is null ...

Eduardo think that the "A___200___12/03/10" was just a field ... but I used "___" to separate the fields... I have 3 columns and not 1 field.

Please do not send me the file. qvw .... Send me examples

Not applicable
Author

DATE(MAX(TOTAL IF(Value <> '', Date)), 'DD/MM/YY')

Not applicable
Author

did not work out too... but I used:

if(VALUE>=0,maxstring(if(VALUE>=0,DATE)))

and it worked.