Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

Calculation based on previous number

Hi,

Kindly find below table and required otuput. This needs to be achieved in frontend. Please assist.

    

ChannelValue %Calculation !Required Output
A-15If(Negative then 0)0
B5-15+5 = -10 (Again negative then 0)0
C13-10 + 13 = 33
D32 32
E65 65
Total100 100

stalwar1

Regards

Sumeet

1 Solution

Accepted Solutions
Highlighted

Re: Calculation based on previous number

May be try this

=If(Alt(Above(RangeSum(Above(Sum(Value), 0, RowNo()))), -1) < 0, RangeMax(RangeSum(Above(Sum(Value), 0, RowNo())), 0), Sum(Value))


Capture.PNG

View solution in original post

5 Replies
Highlighted
Creator II
Creator II

Re: Calculation based on previous number

Hi, try this,

tmp:

LOAD * Inline [

Channel, Value

A, -15

B, 5

C, 13

D, 32

E, 65

];

tmp1:

LOAD

Channel,

Value,

if(RowNo() = 1, Value,

Peek(x) + Value)  as x

Resident tmp;

DROP Table tmp;

tmp2:

LOAD

*,

if(y < 0, 0, y) as z;

LOAD

*,

if(Peek(x) > 0, Value, x) as y

Resident tmp1;

DROP Table tmp1;

DROP Fields x,y;

Reguards

Highlighted
Creator III
Creator III

Re: Calculation based on previous number

try this

create one straight table and

add the dimension as channel

expression 1 as sum(value)

expression 2 as =if(RangeSum(Above(Value,0,2))<0,'0',RangeSum(Above(Value,0,2)))

Highlighted

Re: Calculation based on previous number

May be try this

=If(Alt(Above(RangeSum(Above(Sum(Value), 0, RowNo()))), -1) < 0, RangeMax(RangeSum(Above(Sum(Value), 0, RowNo())), 0), Sum(Value))


Capture.PNG

View solution in original post

Highlighted
Creator III
Creator III

Re: Calculation based on previous number

great

Highlighted
Partner
Partner

Re: Calculation based on previous number

Great Sunny..!!! Thanks a ton

Regards

Sumeet