This is a migrated thread and some comments may be shown as answers.

Need previous row field value

3 Answers 109 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Norseman
Top achievements
Rank 1
Norseman asked on 19 Sep 2012, 09:28 PM
For each row in a detail section, I need the field value from the same field in the previous row to calculate the difference. Is this possible and if yes, how?

:o)
Jon Ivar

3 Answers, 1 is accepted

Sort by
0
IvanY
Telerik team
answered on 21 Sep 2012, 04:28 PM
Hello Jon,

Such operations are far easier in SQL and therefore it will be best if you perform them there. The snippet may look like this:
select t1.value - t2.value from table t1, table t2
where t1.primaryKey = t2.primaryKey - 1

Of course you may want to order the query as the results may be unexpected otherwise. Name the resulting value to use it in your report easily.

If you are not using sql data source this task can be even easier and performed in code for example.

Kind regards,
IvanY
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Norseman
Top achievements
Rank 1
answered on 23 Sep 2012, 08:58 PM
Hi Ivan
Yes, this will work by using a temp table. Thanks for the feedback.

:o)
Jon Ivar
0
Gaurav
Top achievements
Rank 1
answered on 01 Jul 2013, 06:50 AM
But Question still remain.... Is it Possible in designer or not ??
Tags
General Discussions
Asked by
Norseman
Top achievements
Rank 1
Answers by
IvanY
Telerik team
Norseman
Top achievements
Rank 1
Gaurav
Top achievements
Rank 1
Share this question
or