Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to subract the data in running total

if I have a column inital_inv and first row has data and second row data will come

Initial Inv

200

-

-

-

-

Demand

50

20

60

30

Initial_inv-Demand

I need the output

200

150

130

70

40

How can i achive. Please help me.

Thanks,

Nishant

5 Replies
sunny_talwar

You probably would need to use Peek() vs Previous() – When to Use Each to get this done. Here is another place you can read about it: Peek() or Previous() ?

For more detailed help, I would suggest you to provide a sample where we can see your data model to help you better

Not applicable
Author

Hello Sunny,

I have only one initial_inv as per Material code. Giving full example.

Material

M1

M1

M1

M1

M2

M2

M2

Initial Inv

200

Demand

50

20

60

30

Output need

200

150

130

70

40

How this subtract will happen durning running the dashborad in qliksense.

Thank you for helping me.

Thanks,

Nishant

Not applicable
Author

Hello Sunny,

I got the result.. Thank you for helping me.

Now one more help i need.

I've a columns

Step 1

1

1

1

1

1

0

0

1

1

1

1

1

I need output like

Step 2

5

4

3

2

1

0

0

5

4

3

2

1

How can i count in reverse order and avoid the 0

thanks,

Nishant

Anonymous
Not applicable
Author

Hi Nishant,

Are You expecting this ?

5

4

3

2

1

On what basis it should be scripted ?

Not applicable
Author

Hello,

Yes, But need to write the expression in qliksense.

Can you provide me the solution .

Thanks,

Nishant