Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

henster36
New Contributor III

Get last date for which has a value

Hi,

I have the following table:

DateProduction (meters)
01/02/2013108
02/02/2013502
03/02/2013300
04/02/20130
05/02/20130

I want to get the last date which has got a Production value (so it will be 03/02/2013 because the dates thereafter has not values). The date must be able to show in a text box.

How can I do it using a formula/expression?

Thank you in advance

1 Solution

Accepted Solutions
Not applicable

Re: Get last date for which has a value

Hi Hennie,

You should solve with this exèression:

Max( {<Production={">0"}>} Date)

Hope it helps

Giampiero

7 Replies
vivientexier
Contributor II

Re: Get last date for which has a value

Add a flag in your script (1 when Production >0),

Then your expression will be easy Max({< Flag_production_value = {1} >} Date)

MVP
MVP

Re: Get last date for which has a value

Hi

This should do it

=Date(Max(If(Production <> 0, Date)))

Hope that helps

Jonathan

Not applicable

Re: Get last date for which has a value

Hi Hennie,

You should solve with this exèression:

Max( {<Production={">0"}>} Date)

Hope it helps

Giampiero

manideep78
Valued Contributor

Re: Get last date for which has a value

Hi,

This should work, try this

=Date(Max({<Production={"<>0"}>}Date))

sushil353
Honored Contributor II

Re: Get last date for which has a value

hi

try this

=Date(max({<Production ={"<>0"}>} Date_t))

find the sample application

HTH

Sushil

Highlighted
anantmaxx
Contributor III

Re: Get last date for which has a value

Hi ,

do the below

1.In script load date as  Num(Date) as Date

2.use set ananlysis in text object         =sum({<Date={$(=max(Date))}>}value)

Regards,

Anant Dubey

henster36
New Contributor III

Re: Get last date for which has a value

Thank you everyone! I've now got a few expressions from which I can pick and choose!