Solved

crystal formula - date range 1,2,3 months

Posted on 2008-10-28
8
279 Views
Last Modified: 2011-09-20
Hi,
How can I create formula like this ? What function should I use ?
Example:
if {date.field} in last0to30days then {qnty} * {price}  else 0
I need formula for:
0to30 days back from currentdate
31to60days back from currentdate
61to90days back from currentdate
Maybe I should use something with month({date.filed)=....
please advise
henry
0
Comment
Question by:henryk123
  • 5
  • 3
8 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 22823573
if {date.field} in Aged0to30days then
{table.qnty} * {Table.price}  
else
0
0
 
LVL 77

Expert Comment

by:peter57r
ID: 22823601
Sorry - posted too early...
For your 30 days formula use...

if {table.datefield} in Aged0to30days then
{table.qnty} * {Table.price}  
else
0

Then create similar formulas using
Aged31to60days
Aged61to90days
0
 

Author Comment

by:henryk123
ID: 22823776
thx working good
Can I ask something more ?
0
 
LVL 77

Expert Comment

by:peter57r
ID: 22823934
As long as it is related to this Q, then Yes.
Otherwise post a new Q.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:henryk123
ID: 22823970
ok ,
I have subreport in my main report.
I'd like show in main report's footer sums from subreport's report footer. How to do that ?
0
 
LVL 77

Expert Comment

by:peter57r
ID: 22824590
You have to declare a shared variable in the main report
(formula field in the report header - example:
shared numbervar mytot:=0;
""

In the subreport footer, create a formula field, declare the same variable and assign it the value you want it to have.

In the main report footer, create a formula field and declare the shared variable again and also specify it as the output .
0
 

Author Comment

by:henryk123
ID: 22824996
In my subreport i have formula field in report header {@sum shipments}
inside: sum ({@ship0to30}) + sum({@ship31to60}) + sum ({@ship61to90})
I need this field use in main report:

I prepared something like that:

In main report header:
WhilePrintingRecords;
Shared NumberVar SubValue1;

In subreport - report footer:
WhilePrintingRecords;
Shared NumberVar SubValue1;
SubValue1:={@ship0to30};

In mainreport after subreport:
WhilePrintingRecords;
Shared NumberVar SubValue1;
SubValue1

Finish formula:
I'd like show diffrenece between sums (sum from main report and sum from subreport)
My formula:
WhilePrintingRecords;
Shared NumberVar Subvalue1;
{@sum backlog}- subvalue1

Unfortunately, doesn't work.
Shows me numbers but completely incorrect.  
Did I any mistakes in formulas or this share values don't work good with sums ?
h





0
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 22825076
All looks as it should to me.
Can you temporarily show the result of this formula as below and see if looks OK...

In subreport - report footer:
WhilePrintingRecords;
Shared NumberVar SubValue1;
SubValue1:={@ship0to30};
subvalue1
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now