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: 
Anonymous
Not applicable

First Non-zero value in a chart

Sample file attached. Expectation is to have in FinalResult column, first non-zero value from the grouping if Sum is zero:

  

Cat2=Cat1&'-'&Cat3Sum(Value)Final Result
1A-X28.228.2
2A-X29.329.3
3A-X029.3
4A-X029.3
5A-X029.3
1A-Y22.622.6
2A-Y21.921.9
3A-Y021.9
4A-Y021.9
5A-Y27.627.6
1B-X23.423.4
2B-X29.229.2
3B-X029.2
4B-X23.823.8
5B-X25.725.7


Above() only works for one-level above. Trying to see if FristSortedtValue() would work.

Thank you.

1 Solution

Accepted Solutions
jayanttibhe
Creator III
Creator III

Check attached-  is it something you are looking for ?

View solution in original post

18 Replies
jayanttibhe
Creator III
Creator III

You can handle it in script like:

TEST11:

Load Cat1,Cat2,

If(Val= 0, Rangesum(Val,Peek(Val)),Val) As Val

;

LOAD * INLINE [

    Cat1, Cat2, Val

    1, A, 28.5

    1, B, 29.3

    1, C, 27.8

    1, D, 0

    1, E, 0,

    1, F, 0

    2, A, 22.6

    2, B, 0

    2, C, 21.9

];

sunny_talwar

Can you share a sample app to test this out?

Anonymous
Not applicable
Author

Hi Jayant,

This needs to be done in the chart.

Anonymous
Not applicable
Author

Attached it.

sunny_talwar

May be this?

If(Sum(Value)<>0,Sum(Value), Above(Column(2)))

Capture.PNG

Anonymous
Not applicable
Author

This is going to be a line chart eventually and column(2) won't be there. Any other options ?

jayanttibhe
Creator III
Creator III

Check attached-  is it something you are looking for ?

sunny_talwar

I guess he need this specifically on the front end and that could be because of use of a complicated expression

jayanttibhe
Creator III
Creator III

Well Sunny - I would prefer to do it in backend. As if sorting order on front end changed then the solution will not work . What do you think ?

Moreover, its not difficult to built in backend.