Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Previous Value Post Reply Post New Topic
Author Message
Motib
Newbie
Newbie


Joined: 06 Feb 2013
Location: Pakistan
Online Status: Offline
Posts: 5
Quote Motib Replybullet Topic: Previous Value
    Posted: 03 Jul 2013 at 6:51pm
Hello All,
        my name is Motib. I am vb6,vb.net developer. i am using crystal report 8.5, 2008, 2012 for reports. I am making a report which have rate column. but i want to check last rate of the vendor.... i am trying to do this with previous({@CreditRate})..... but it is not working correctly..... this report is grouped by item id.
basically it is item wise ledger...
item:              Pepsi

vendor name           rate          last rate
abc                    13              12
xyz                    32              31.5
is any here here who help me in this.......

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 09 Jul 2013 at 5:07am
Previous() does not care about group changes, so you need to take that into account.

also, you are calling Previous on a formula...the formula should use the previous command...at least I would think

HTH
IP IP Logged
Motib
Newbie
Newbie


Joined: 06 Feb 2013
Location: Pakistan
Online Status: Offline
Posts: 5
Quote Motib Replybullet Posted: 09 Jul 2013 at 8:36pm
thank,s for your reply HTH

actually i am customize a report in ERP. is there any another way to get the second last Value of the records??

Edited by Motib - 09 Jul 2013 at 8:37pm
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 10 Jul 2013 at 4:48am
You can use the Previous, you just need to check that the grouping criteria is correct.

Say you are grouping on {table.Group} and you are looking at {table.Value}
you can use the Previous({table.Value}) but you probably want to do something like:

if Previous({table.Group}) = {table.Group} then //in the same group
Previous({table.Value})
else
0

HTH
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.