Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Fetch the First Not NULL Value

Hi All,

Hope everybody is good.

Can somebody please help me for the below scenario?

 

YEARSALE
2000
2001
2002
2003678
2004243
2005800
2006

456

I want an expression to fetch the first Year value having NOT NULL value of SALE.


In this case I want 2003.


Your Help is appreciated.


Regards

Srawan

10 Replies
Digvijay_Singh

May be like this -

=Min({<SALE={"<>ISNULL()"}>}YEAR)

sunny_talwar

May be this:

Sum({<YEAR = {$(=Min({<YEAR = {"=Sum(SALE) > 0"}>}YEAR))}>}SALE)

swuehl
MVP
MVP

If there are really only values for years > 2003, you can try

=Min({<SALE = {"*"}>} YEAR)

sunny_talwar

Sample image and app attached

Capture.PNG

vishsaggi
Champion III
Champion III

Where do you want this to show?

Extending Vijays's Expression you can also use adding a straight table with Year Dim and Expr as below

= Min({< SALE -= {''}>} SALE)

swuehl
MVP
MVP

That's not returning 2003, Sunny

Srawan, if your SALES values could also be just blank, you could also try

=Min({<SALE = {">0"}>}YEAR)

or

=Min({<SALE = {"=Len(Trim(SALE))"} >} YEAR)

sunny_talwar

I am not sure if the OP needs to just return the year or the sales associated with that year. If the year is needed, you are bang on target

swuehl
MVP
MVP

Yes, could be the case.

Another option for this would be

=FirstSortedValue({<SALE = {">0"}>}SALE, YEAR)

Not applicable
Author

Thanks  a lot the solution worked.