Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: using a value returned by a formula ??? Post Reply Post New Topic
Author Message
dimmu
Newbie
Newbie
Avatar

Joined: 24 Jan 2009
Location: Morocco
Online Status: Offline
Posts: 8
Quote dimmu Replybullet Topic: using a value returned by a formula ???
     Posted: 28 Jan 2009 at 5:23am
Hello everyone,
 
i need to know if i can catch and use the value returned by a formula ?? and how to do it ?
 
i need your help,
 
thank you !!


Edited by dimmu - 28 Jan 2009 at 5:24am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Jan 2009 at 5:48am
The general answer is yes you can do this but please describe what you are trying to do for more help.
IP IP Logged
dimmu
Newbie
Newbie
Avatar

Joined: 24 Jan 2009
Location: Morocco
Online Status: Offline
Posts: 8
Quote dimmu Replybullet Posted: 28 Jan 2009 at 6:05am
thank you DBlank for your answer,
 
actually i made a formula which calculate a duration of time based on some functions, and i want to use the duration returned by this formula inside another formula.
so how can i call that formula or rather the value returned form inside the new formula that i want to create ??
 
one more question please,  what about total or summary fields (i don't know the exact name in english because i'm using a french version of crystal report ) whcih calculate sum,avg,max,min... ? can we do the same thing with them ? i mean catch the value returned by them ??
 
thank you a lot for your help
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Jan 2009 at 6:09am
Generally yes you can do both things but at a certain point you will get errors if you try to use a summary a
Into another formula that is also a summary.
IP IP Logged
dimmu
Newbie
Newbie
Avatar

Joined: 24 Jan 2009
Location: Morocco
Online Status: Offline
Posts: 8
Quote dimmu Replybullet Posted: 28 Jan 2009 at 6:20am
i see,
 
so how can i catch and use a value returned by a formula1 inside another formula2 ??
 
i tried to write inside my formula2 :
 
if @formula1>0 then.... 
but it didn't work :(
 
help me please.
 
thank you
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Jan 2009 at 8:45am
Can you post both formulas and what you are trying to do with them? You can often just expand your "if then" formula to query the original data and not worrry about the first formula at all.
IP IP Logged
dimmu
Newbie
Newbie
Avatar

Joined: 24 Jan 2009
Location: Morocco
Online Status: Offline
Posts: 8
Quote dimmu Replybullet Posted: 28 Jan 2009 at 12:19pm
hey DBlank,

i created a formula which calculate duration of time (in hours) for each row under each group of the data ( because data is grouped by Call_status and i calculate time duration in hours of each row under status call )

after that i created a total field which summarize all of the formulas's values (number of hours) under each group.

now i wanna create a formula which calculate the duration of time from the begin of the call creation until the end of the call minus the value returen by the total field ( number of hours ).

so how can i call the value returned by the total field from the formula which i wanna create, please give me the syntax.

thank you a lot
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Jan 2009 at 1:07pm
I think this is referencing the same issue you posted that lockwelle is helping you with (http://www.crystalreportsbook.com/Forum/forum_posts.asp?TID=5341), correct? It that is the case putting two posts for the same problem is generally not good practice. Lockwelle is better equipped to answer this question so I am deferring to him under your other post. You will have to use shared variables to do what you are asking there (in order to get your total time off of multiple records) and that gets more complicated than just using basic formulas as you were doing. Wait for lockwelle to answer your request for assistance on that post.
IP IP Logged
dimmu
Newbie
Newbie
Avatar

Joined: 24 Jan 2009
Location: Morocco
Online Status: Offline
Posts: 8
Quote dimmu Replybullet Posted: 28 Jan 2009 at 3:51pm
thank you DBlank !!

oh sorry, i just wanted to get an answer asap by posting my question, and posting a way which i thought it may fix the problem. but i think you're right.

i will wait for lockwelleto help me.

( if you don't mind where can i declare a shared variable and how ? )

thank you
IP IP Logged
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