# QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

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&'-'&Cat3 Sum(Value) Final Result 1 A-X 28.2 28.2 2 A-X 29.3 29.3 3 A-X 0 29.3 4 A-X 0 29.3 5 A-X 0 29.3 1 A-Y 22.6 22.6 2 A-Y 21.9 21.9 3 A-Y 0 21.9 4 A-Y 0 21.9 5 A-Y 27.6 27.6 1 B-X 23.4 23.4 2 B-X 29.2 29.2 3 B-X 0 29.2 4 B-X 23.8 23.8 5 B-X 25.7 25.7

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

Thank you.

Tags (3)
1 Solution

Accepted Solutions
Contributor III

## Re: First Non-zero value in a chart

Check attached-  is it something you are looking for ?

18 Replies
Contributor III

## Re: First Non-zero value in a chart

You can handle it in script like:

TEST11:

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

;

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

];

MVP

## Re: First Non-zero value in a chart

Can you share a sample app to test this out?

New Contributor

## Re: First Non-zero value in a chart

Hi Jayant,

This needs to be done in the chart.

New Contributor

Attached it.

MVP

## Re: First Non-zero value in a chart

May be this?

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

Highlighted
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 ?

Contributor III

## Re: First Non-zero value in a chart

Check attached-  is it something you are looking for ?

MVP

## 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

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.