Create a formula based on UserResponse()
Am trying to create a var based on Count(Payperiod) for overall report however whenever I include the formula at row level the value reverts to the individual row. How can context be overriden? e.g. Formula is Sum(HrsWorked)/Count(Payperiod)
Where Count(Payperiod) is based on a range of dates selected from UserResponse() for a Beginning and Ending Payperiod.
Report contains record for each employee and If Count(Payperiod) = 3 but that employee may have only HrsWorked recorded for one of the Payperiods
I want calculation to use HrsWorked for each employee but I need to use the number of payperiods based on the UserResponse()s not on number of Payperiods recorded for employee.
Hi
try this syntax
Sum(HrsWorked)/(Count(Payperiod) In Report)
Regards,
Stratos
Similar Messages
-
Create a formula based on another cell
I would like to create a formula which gives a total/percentage based on the content of another cell.
For example, if A3 contains text "apple", then multiply A7 * 5%; If A3 contains "banana", then multiply A7* 3% and so on.
I have tried using the 'IF' and 'IF-true' functions to no avail.
Any suggestions?
Thanks!Hi Harveycw,
A Lookup table containing names of fruit and the relevant multipliers
Fruit
Multiplier
Apple
5
Banana
3
Cherry
4
Date
9
Eugenia
11
Fig
6
Grape
7
Huckleberry
8
Main table
Fruit
Value
New Value
Apple
100
5
Banana
100
3
Apple
1000
50
Banana
1000
30
Grape
100
7
Grape
200
14
Formula in C2 (and Fill Down)
=B2×VLOOKUP(A2,Lookup::A:B,2,FALSE)÷100
Regards,
Ian. -
How to create a formula based on group level
Hi,
If there are three group level ins a report:
How can I creat a formula to put on page header depended on current group level?
Thanks!Thanks, Abhilash ans Sastry
I really try to do is to show different text on page header depend on which group level is. the reason is that if there are multi pages group footer, only the first page has group name on tilte if I put group name on the footer.
I would like to put group name on page header, but have to know which group level is.
Thanks again -
How to create a formula based condition in bex query designer
hi all,
i have scenario in query designer where i need to calculate Key performance indexes based on characters and key figures iam using.for example the condition is like:
"if call received is less than call projection then give call received else null"
how and where to define the condition and i need to name the condition to display it seperatly.please help me in this issue.
regards
Vamshi D Krishnahi you have to break down your conditions and then code for them.
for e.ge.
if actual == 0
vart = 0.
else if actual-target ==0
vart = 0.001
else
vart = actual -target
endif
endif
now we start with first condition use operators from boolean catagory
(Actual != 0)*(other amount)
this solves first if condition... if actual = 0 value actual != 0 will be zero we got our desired value.
if other case then we have give else condition.
(Actual != 0)*(((actual - target) == 0 )*0.001+((actual-target)!=0)*(actual-target))
in the second half we have coded the else part.
in the same way you can proceed for your logic -
How to create a formula to get the month name based on userresponse
Hi,
I have created a report using E-Fashion - Actually i need a report like - For ex i need 4 months data from 12 months
My report should display the 4 months data along with starting & end month data in the next 2 columns
I have used the prompt to fetch the data & i have created a formula in the cloumn like below:
For the column haader i have given = Tonumber(userresponse("Enter start:")) - I am getting the Month number in the header But i need the month name in the header.Please guide me
Regards
KarthikaHi Ram,
Thanks for your Help.I tried in an another way like I created 2 Variable -
Start Date =UserResponse("Enter Month(Start):"
End Date = =UserResponse("Enter Month(End):"
I have created the column header for
start date:
=If([start Date] = "1";"January";If( [start Date] = "2"; "February";If([start Date] = "3";"March";If([start Date] = "4";"April";If([start Date] = "5";"May";If([start Date] = "6";"June";If([start Date] = "7";"July";If([start Date] = "8";"August";If([start Date] = "9";"September";If([start Date] = "10";"October";If([start Date] = "11";"November";If([start Date] = "12";"December"))))))))))))
End Date:
=If([End Date] = "1";"January";If( [End Date] = "2"; "February";If([End Date] = "3";"March";If([End Date] = "4";"April";If([End Date] = "5";"May";If([End Date] = "6";"June";If([End Date] = "7";"July";If([End Date] = "8";"August";If([End Date] = "9";"September";If([End Date] = "10";"October";If([End Date] = "11";"November";If([End Date] = "12";"December"))))))))))))
For the Datas in the column:
Start Date:
=[Sales revenue] Where([Month]=ToNumber(UserResponse("Enter Month(Start):")))
End Date:
=[Sales revenue] Where([Month]=ToNumber(UserResponse("Enter Month(End):")))
I got the Report format as i required
Thanks
Karthika -
How to create Formula based value field in COPA
Hi,
I want to know how to create formula based value field in COPA
My Requirement is i want to collect some value in formula based value field and want to use in copa allocation cycle as a tracing
factor.
anybody give some light on the same topic or requirement ?
Thanks
Nilesh RThe key figure you are creating in KE2K is not a value field, i.e. you can't post to it and you can't use it in a report. It is a caluculated value that can be used only in assessment and top-down-distribution.
In Ke2K, enter a name for your key figure, then click on the the white sheet button to create it. Now the formular area is open for input. Input your formular (e.g. VV001 + VV002 - VV003 .... where VVXXX are the technical names of value fields).
Now click the "check formuar"-button. Then save.
Before you can use the key figure in assessment, execute TC KEUG.
Now the key figure is available as any value field in the tracing factor selection of your assessment cycle.
I hope this made it clearer.
Regards
Nikolas -
Create a report based on sample data!
Hello all,
I would like to get some helps for creating a report based on the following table data in the database:
Class | Name | Student
=======================================
1 | Algebra | 60
1 | Extra Algebra | 20
2 | Calculus | 80
2 | Extra Calculus | 10
3 | Geometry | 90
What I expect to have the layout of report should be look like as below:
School Register Report
ClassGroup | Name | Ontime register | Late register
=========================================================
1 | Algebra | 60 | 20
2 | Calculus | 80 | 10
3 | Geometry | 90 |
Please tell it is possible to do it in Crystal Report? Please help with solution. Thanks in advance.Assumimg second type always starts with Extra then, create formula
@Name
If like 'Extra*' then mid(, 7,20) else
Group on this formula
@LateReg
If like 'Extra*' then else 0
@OnTimeReg
If not( like 'Extra*') then else 0
Add Maximum smmaries of these formula to @Name Group footer, suppress details and group header
Ian -
Tax procedure condition based / formula based
Hi,
I have a query.
1.Based on tax procedure how we can identify that the tax procedure is formula based or condition based.
2.what are advantages over one another.
3.Is their any other way we can find out tax procedure attached to po is formula based / condition based.
4.What is sequence to create procedure and maintain record for these two procedure.
Thanks & Regards
Atharva G.Hi Atharva,
I will list out the differences and advamtages between the two
TAX INJ procedure is formula based
TAX INN procedure is condition based
In TAX INJ to define the tax rates we are using excise tax rate in J1ID AND tax code ( FTXP)
In TAXINN nothing we are entering in tax code also , we are entering every duties in FV11( condition records)
Amending the duty rates is very easy in case of TAXINN than TAXINJ since we are mentioning the tax duties in FV11 through validity periods, if the tax rate is changed from that date we can maintain the record for the new period in FV11
IN TAXINN assign taxcode to company code is manadatory but its not manadatory in case of TAXINJ
Kindly get back to me, if you have any more clarifications.
Balakrishna R.V
Sonata Software Pvt Ltd. -
Hi All,
I need to create a pricing formula ( through txn VOFM ) but i have a doubt regarding type of formula that i should use. In txn VOFM there are following type of conditions based upon which we can create a formula:
1) Scale Base
2) Condition Base Value
3) Condition Value
4) Structure of Grp Key
5) Rounding Rules
Can you please provide some documentation or explanation on these five types so that i can choose according to my requirement.
It's Urgent.
Thanks in Advance
~Jasmeetclosing this thread
-
How to create a report based on a DataSet programatically
I'm working on a CR 2008 Add-in.
Usage of this add-in is: Let the user choose from a list of predefined datasets, and create a totally empty report with this dataset attached to is. So the user can create a report based on this dataset.
I have a dataset in memory, and want to create a new report in cr2008.
The new report is a blank report (with no connection information).
If I set the ReportDocument.SetDataSource(Dataset dataSet) property, I get the error:
The report has no tables.
So I must programmatically define the table definition in my blank report.
I found the following article: https://boc.sdn.sap.com/node/869, and came up with something like this:
internal class NewReportWorker : Worker
public NewReportWorker(string reportFileName)
: base(reportFileName)
public override void Process()
DatabaseController databaseController = ClientDoc.DatabaseController;
Table table = new Table();
string tabelName = "Table140";
table.Name = tabelName;
table.Alias = tabelName;
table.QualifiedName = tabelName;
table.Description = tabelName;
var fields = new Fields();
var dbField = new DBField();
var fieldName = "ID";
dbField.Description = fieldName;
dbField.HeadingText = fieldName;
dbField.Name = fieldName;
dbField.Type = CrFieldValueTypeEnum.crFieldValueTypeInt64sField;
fields.Add(dbField);
dbField = new DBField();
fieldName = "IDLEGITIMATIEBEWIJS";
dbField.Description = fieldName;
dbField.HeadingText = fieldName;
dbField.Name = fieldName;
dbField.Type = CrFieldValueTypeEnum.crFieldValueTypeInt64sField;
fields.Add(dbField);
// More code for more tables to add.
table.DataFields = fields;
//CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo info =
// new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
//info.Attributes.Add("Databse DLL", "xxx.dll");
//table.ConnectionInfo = info;
// Here an error occurs.
databaseController.AddTable(table, null);
ReportDoc.SetDataSource( [MyFilledDataSet] );
//object path = @"d:\logfiles\";
//ClientDoc.SaveAs("test.rpt", ref path, 0);
The object ClientDoc referes to a ISCDReportClientDocument in a base class:
internal abstract class Worker
private ReportDocument _ReportDoc;
private ISCDReportClientDocument _ClientDoc;
private string _ReportFileName;
public Worker(string reportFileName)
_ReportFileName = reportFileName;
_ReportDoc = new ReportDocument();
// Load the report from file path passed by the designer.
_ReportDoc.Load(reportFileName);
// Create a RAS Document through In-Proc RAS through the RPTDoc.
_ClientDoc = _ReportDoc.ReportClientDocument;
public string ReportFileName
get
return _ReportFileName;
public ReportDocument ReportDoc
get
return _ReportDoc;
public ISCDReportClientDocument ClientDoc
get
return _ClientDoc;
But I get an "Unspecified error" on the line databaseController.AddTable(table, null);
What am i doing wrong? Or is there another way to create a new report based on a DataSet in C# code?Hi,
Have a look at the snippet code below written for version 9 that you might accommodate to CR 2008, it demonstrates how to create a report based on a DataSet programmatically.
//=========================================================================
+ * the following two string values can be modified to reflect your system+
+ ************************************************************************************************/+
+ string mdb_path = "C:
program files
crystal decisions
crystal reports 9
samples
en
databases
xtreme.mdb"; // path to xtreme.mdb file+
+ string xsd_path = "C:
Crystal
rasnet
ras9_csharp_win_datasetreport
customer.xsd"; // path to customer schema file+
+ // Dataset+
+ OleDbConnection m_connection; // ado.net connection+
+ OleDbDataAdapter m_adapter; // ado.net adapter+
+ System.Data.DataSet m_dataset; // ado.net dataset+
+ // CR variables+
+ ReportClientDocument m_crReportDocument; // report client document+
+ Field m_crFieldCustomer;+
+ Field m_crFieldCountry;+
+ void CreateData()+
+ {+
+ // Create OLEDB connection+
+ m_connection = new OleDbConnection();+
+ m_connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + mdb_path;+
+ // Create Data Adapter+
+ m_adapter = new OleDbDataAdapter("select * from Customer where Country='Canada'", m_connection);+
+ // create dataset and fill+
+ m_dataset = new System.Data.DataSet();+
+ m_adapter.Fill(m_dataset, "Customer");+
+ // create a schema file+
+ m_dataset.WriteXmlSchema(xsd_path);+
+ }+
+ // Adds a DataSource using dataset. Since this does not require intermediate schema file, this method+
+ // will work in a distributed environment where you have IIS box on server A and RAS Server on server B.+
+ void AddDataSourceUsingDataSet(+
+ ReportClientDocument rcDoc, // report client document+
+ System.Data.DataSet data) // dataset+
+ {+
+ // add a datasource+
+ DataSetConverter.AddDataSource(rcDoc, data);+
+ }+
+ // Adds a DataSource using a physical schema file. This method require you to have schema file in RAS Server+
+ // box (NOT ON SDK BOX). In distributed environment where you have IIS on server A and RAS on server B,+
+ // and you execute CreateData above, schema file is created in IIS box, and this method will fail, because+
+ // RAS server cannot see that schema file on its local machine. In such environment, you must use method+
+ // above.+
+ void AddDataSourceUsingSchemaFile(+
+ ReportClientDocument rcDoc, // report client document+
+ string schema_file_name, // xml schema file location+
+ string table_name, // table to be added+
+ System.Data.DataSet data) // dataset+
+ {+
+ PropertyBag crLogonInfo; // logon info+
+ PropertyBag crAttributes; // logon attributes+
+ ConnectionInfo crConnectionInfo; // connection info+
+ CrystalDecisions.ReportAppServer.DataDefModel.Table crTable;+
+ // database table+
+ // create logon property+
+ crLogonInfo = new PropertyBag();+
+ crLogonInfo["XML File Path"] = schema_file_name;+
+ // create logon attributes+
+ crAttributes = new PropertyBag();+
+ crAttributes["Database DLL"] = "crdb_adoplus.dll";+
+ crAttributes["QE_DatabaseType"] = "ADO.NET (XML)";+
+ crAttributes["QE_ServerDescription"] = "NewDataSet";+
+ crAttributes["QE_SQLDB"] = true;+
+ crAttributes["QE_LogonProperties"] = crLogonInfo;+
+ // create connection info+
+ crConnectionInfo = new ConnectionInfo();+
+ crConnectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;+
+ crConnectionInfo.Attributes = crAttributes;+
+ // create a table+
+ crTable = new CrystalDecisions.ReportAppServer.DataDefModel.Table();+
+ crTable.ConnectionInfo = crConnectionInfo;+
+ crTable.Name = table_name;+
+ crTable.Alias = table_name;+
+ // add a table+
+ rcDoc.DatabaseController.AddTable(crTable, null);+
+ // pass dataset+
+ rcDoc.DatabaseController.SetDataSource(DataSetConverter.Convert(data), table_name, table_name);+
+ }+
+ void CreateReport()+
+ {+
+ int iField;+
+ // create ado.net dataset+
+ CreateData();+
+ // create report client document+
+ m_crReportDocument = new ReportClientDocument();+
+ m_crReportDocument.ReportAppServer = "127.0.0.1";+
+ // new report document+
+ m_crReportDocument.New();+
+ // add a datasource using a schema file+
+ // note that if you have distributed environment, you should use AddDataSourceUsingDataSet method instead.+
+ // for more information, refer to comments on these methods.+
+ AddDataSourceUsingSchemaFile(m_crReportDocument, xsd_path, "Customer", m_dataset);+
+ +
+ // get Customer Name and Country fields+
+ iField = m_crReportDocument.Database.Tables[0].DataFields.Find("Customer Name", CrFieldDisplayNameTypeEnum.crFieldDisplayNameName, CeLocale.ceLocaleUserDefault);+
+ m_crFieldCustomer = (Field)m_crReportDocument.Database.Tables[0].DataFields[iField];+
+ iField = m_crReportDocument.Database.Tables[0].DataFields.Find("Country", CrFieldDisplayNameTypeEnum.crFieldDisplayNameName, CeLocale.ceLocaleUserDefault);+
+ m_crFieldCountry = (Field)m_crReportDocument.Database.Tables[0].DataFields[iField];+
+ // add Customer Name and Country fields+
+ m_crReportDocument.DataDefController.ResultFieldController.Add(-1, m_crFieldCustomer);+
+ m_crReportDocument.DataDefController.ResultFieldController.Add(-1, m_crFieldCountry);+
+ // view report+
+ crystalReportViewer1.ReportSource = m_crReportDocument;+
+ }+
+ public Form1()+
+ {+
+ //+
+ // Required for Windows Form Designer support+
+ //+
+ InitializeComponent();+
+ // Create Report+
+ CreateReport();+
+ //+
+ // TODO: Add any constructor code after InitializeComponent call+
+ //+
+ }+//========================================================================= -
Is there a way to create a collection based on the "previous import"?
is there a way to create a collection based on the "previous import"? that would make it easy to mobile sync the last import to my ipad, and do further picking/rejecting while away from my laptop.
well, yes, of course i could do it that way. i guess i wasn't specific enough. is there a way to create a smart collection, with the photos in the "previous import" as members of the smart collection. earlier i mentioned about using this smart collection to mobile sync with my ipad, to do further flagging.
so my intention, use a smart collection to mobile sync with my ipad, and the smart collection to include the photos from my previous import.
i guess another way to ask the question, is there a way to create a smart collection, by using some rule or condition in the smart collection, to automatically include previous import photos.
the documentation says that "previous import" is a collection, even though it shows up in the catalogue side bar section. but i see no way to choose that collection when making a smart collection.
jd -
Create a JTable based on an ArrayList containing instances of a class.
I have a class, IncomeBudgetItem, instances of which are contained in an ArrayList. I would like to create a JTable, based on this ArrayList. One variable is a string, while others are type double. Not all variables are to appear in the JTable.
The internal logic of my program is already working. And my GUI is largely constructed. I'm just not sure how to make them talk to each other. The actually creation of the JTable is my biggest problem right now.import java.awt.Dimension;
import java.awt.GridLayout;
import java.util.ArrayList;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.AbstractTableModel;
public class TableDemo extends JPanel {
private boolean DEBUG = false;
public TableDemo() {
super(new GridLayout(1, 0));
ArrayList<MyObject> list = new ArrayList<MyObject>();
list.add(new MyObject("Kathy", "Smith", "Snowboarding", new Integer(5),
new Boolean(false)));
list.add(new MyObject("John", "Doe", "Rowing", new Integer(3),
new Boolean(true)));
list.add(new MyObject("Sue", "Black", "Knitting", new Integer(2),
new Boolean(false)));
list.add(new MyObject("Jane", "White", "Speed reading",
new Integer(20), new Boolean(true)));
JTable table = new JTable(new MyTableModel(list));
table.setPreferredScrollableViewportSize(new Dimension(500, 70));
table.setFillsViewportHeight(true);
// Create the scroll pane and add the table to it.
JScrollPane scrollPane = new JScrollPane(table);
// Add the scroll pane to this panel.
add(scrollPane);
class MyObject {
String firstName;
String lastName;
String sport;
int years;
boolean isVeg;
MyObject(String firstName, String lastName, String sport, int years,
boolean isVeg) {
this.firstName = firstName;
this.lastName = lastName;
this.sport = sport;
this.years = years;
this.isVeg = isVeg;
class MyTableModel extends AbstractTableModel {
private String[] columnNames = { "First Name", "Last Name", "Sport",
"# of Years", "Vegetarian" };
ArrayList<MyObject> list = null;
MyTableModel(ArrayList<MyObject> list) {
this.list = list;
public int getColumnCount() {
return columnNames.length;
public int getRowCount() {
return list.size();
public String getColumnName(int col) {
return columnNames[col];
public Object getValueAt(int row, int col) {
MyObject object = list.get(row);
switch (col) {
case 0:
return object.firstName;
case 1:
return object.lastName;
case 2:
return object.sport;
case 3:
return object.years;
case 4:
return object.isVeg;
default:
return "unknown";
public Class getColumnClass(int c) {
return getValueAt(0, c).getClass();
* Create the GUI and show it. For thread safety, this method should be
* invoked from the event-dispatching thread.
private static void createAndShowGUI() {
// Create and set up the window.
JFrame frame = new JFrame("TableDemo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Create and set up the content pane.
TableDemo newContentPane = new TableDemo();
newContentPane.setOpaque(true); // content panes must be opaque
frame.setContentPane(newContentPane);
// Display the window.
frame.pack();
frame.setVisible(true);
public static void main(String[] args) {
// Schedule a job for the event-dispatching thread:
// creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
} -
How to create the web based report without enterprise portal?
Hi experts,
We don't have enterprise portal but I like to create the web based version of the existing Bex reports and which option is the best to distribute this web based report using information broadcasting?
Can I use report designer for this?
Thanks in advance.
Sharat.Hi Sharat
In BI 7.0 the Queries which u devoleped can be broad casted by using two ways .
1. Enterprise portal
2.Web Application Designer(WAD)
So you can choose any of the option, For the Option 1 you should have seperate server for the EP or else For option 2 you have to make some setting in the BI system to enable the Web reports..
Reagrds
Satish -
How to create an order based on Notification through BAPI_ALM_ORDER_MAINTAIN
Hi
I need to create an order based on the notification no. This is manually can be done using the Standard T.Code IW34.I am using BAPI_ALM_ORDER_MAINTAIN to create an order based on Notification. I am getting the below message( which is success message)
Order %00000000001 saved with number 40001258
BAPI control was ended
Though order is created it not assigned to notification No. I am using ref key as '%00000000001' and also I tried with '%0000000000140232323' where 40232323 is notification No.
And if I checked in order the notification No is assigned to order as '%00000000001'. And when I check back the Notification, the order is not assigned to Notification No. How to assign the created order no to Notification No.
Code is attached for Ref.
Now the problem is the order is not assigned to notification no. Is there any FM or BAPI to do the same fucntionality..!
Regards,
AmarHello Amarnadh,
Keng Haw Soon is right, object key should always have the client like 010.
In your code you were passing it without the client.
Pass like below and it will work.
ls_methods-objectkey = '%00000000001000040232323'.
Regards,
Thanga -
Creating a formula for the Header to evaluate each record in Detail
I want to create a formula that notifies the user in the Header if there is a certain value in the report detail. I was able to create the formula but it only gave me the correct message when the 1st record in the detail had the value. Is there a way for it to read ALL records and if any of them have the value, to display the message?
Example:
Formula in Header: if ({@Total}>1) then "ERROR"
There are about 500 {@Total} fields in the detail and my formula only looks at the 1st one in the list.Hi Shannyn,
There is this in-built faility provided by Crystal Reports called as 'Alerts'.
This will help you meet your requirment.
For more information on functionality / Creation of Alerts, please go to Crystal Reports Help and search for 'Alert'. You will find it very helpful.
Hope this helps.
Regards,
Jay.
Maybe you are looking for
-
Import fixed asset master data
When I try to import fixed asset master data from an excel file to the Sap Business, a problem that I cannot identify occurs, and as a result, data is not imported. The process runs normally, data is processed but at the end an informational message
-
My hard drive failed and during the setup of Illustrator CS4 on my new hard drive/pc, I was told that the maximum # of licenses for my serial number had been reached and so I am unable to install Illustrator on my working computer. This happened a c
-
Since upgrading to newest version through Creative Cloud, Photoshop Freezes at start up: - when launched from LR5 ("modify photo in CC2014"), photoshop launches, photo is displayed, then I get a message that "an incompatibility with the graphics comp
-
Close window in web dynpro abap
Hi, I have a web dynpro application for a workflow. When a user clicks on the workitem in UWL, a window opens with task description and two button on it. When the user clicks on one of the button, my requirement is: I want to close that window. How c
-
How to allow write privileges by a process to files?
Hi there In SPARC-Solaris8: How to allow write privileges by a process to files? Tks in advance, C�sar