Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

bji
New Contributor

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
Contributor III

Re: First Non-zero value in a chart

Check attached-  is it something you are looking for ?

View solution in original post

18 Replies
jayanttibhe
Contributor III

Re: First Non-zero value in a chart

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

];

Re: First Non-zero value in a chart

Can you share a sample app to test this out?

bji
New Contributor

Re: First Non-zero value in a chart

Hi Jayant,

This needs to be done in the chart.

bji
New Contributor

Re: First Non-zero value in a chart

Attached it.

Re: First Non-zero value in a chart

May be this?

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

Capture.PNG

Highlighted
bji
New Contributor

Re: First Non-zero value in a chart

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

jayanttibhe
Contributor III

Re: First Non-zero value in a chart

Check attached-  is it something you are looking for ?

View solution in original post

Re: First Non-zero value in a chart

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

jayanttibhe
Contributor III

Re: First Non-zero value in a chart

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.