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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

First non zero value

Hi all,

Is there a way to get First non zero sorted value?

MonthData
Jan100
Feb100
Mar300
Apr600
May100
Jun700
Jul200
Aug0
Sep0
Oct0
Nov0
Dec0

If the data is as above and my expression is FirstSortedValue(Data,-Month) i would get 0.

But i want 200 which is the firstNONZEROsortedvalue from the last.

5 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

try like this

FirstSortedValue({<Data={">0"}>}Data,-Month)

rajeshvaswani77
Specialist III
Specialist III

Please refer this post.

http://community.qlik.com/message/381968#381968

thanks,

Rajesh Vaswani

MayilVahanan

HI

Try like this

FirstSortedValue({<Data={'=Data>0'}>} Data,-Month)


or as mentioned by celambarasan

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Thanks all.

There is another problem,

My actual values are not from a field called 'Data'

It is actually an aggregation over date

i.e Data = Aggr(SUM(Field1),Date)

Hence i cant use the above expressions.

Rajesh,

the earlier post also was by me:)But,again the same scenario as explained above.

CELAMBARASAN
Partner - Champion
Partner - Champion

Can you attach sample?