Formula to show specific database field Crystal - syntax

Is there any way to set up a formula to display a value depending on the value in another field?
Say if new_field = -1 then display info in new_field2 of that data row? How would a formula for that work?
I've tried it now with doing a formula that just has
if{table.order} = 3 then {table.value} ...the value is a number...but it is just showing 0.0 each time while the value is showing up normally with the other records that display above when just dragging and dropping the database value field into my group. I'm trying to put this formula in the report footer to display additional information on one of the records.

Create a formula similar to the following: #DisplayNote
Global stringvar xx;
if {db.field1.value} = 1 then xx:= "your text" else xx:= ""
Then create a running total formula: #DisplayText
Select the #DisplayNote formula as the field to summarize.
Type of summary = maximum
Then place the #DisplayText on the pagefooter.

In the footer, it is too late to display info on any single record in the report. They have all been processed and are gone by the time the footer is proocessed.
You could probably set up a global variable and set the value in a hidden formula in the detail section when the interesting record is processed. The use a formual to display the global variable value in the footer.

Try inserting the maximum of the formula value into the report footer, instead of the formula value itself.

Related

Robot Framework how to use FOR loop for a specific column in a table

I want to know how to use a FOR loop for a specific column in a table.
Basically. I want to get the text in the third column and equate / verify it to be "LOCAL" for all rows. I will provide a basic diagram of the table
So, in the diagram the checkboxes take up as first table cell and the top row is a table header.
What i want is to get the text of all the cells under column /th4 and equate it to be as "LOCAL" as said before. There might be multiple entries and will be dynamic. So, that is why i want to use FOR loop.
PS: every cell under /th4 is LOCAL , so just want to equate the text.
My code:
Click Element xpath=//*[#id="selectType"]/div/div[2]/ul[2]/li/div
Sleep 0.1
Click Element class=dropdown-btn
Sleep 0.1
Click Button id=filterBtn
Sleep 0.1
Click Element id=closeFilter
Table Row Should Contain xpath=//*[#id="myTable"]/tbody/tr[1]/td[4]/span 1 LOCAL
Table Row Should Contain xpath=//*[#id="myTable"]/tbody/tr[2]/td[4]/span 2 LOCAL
Table Row Should Contain xpath=//*[#id="myTable"]/tbody/tr[3]/td[4]/span 3 LOCAL
Basically, there is filter option... once i filter, the fourth /td in the table will all contain text "LOCAL".
Instead of me manually typing "table row should contain" keyword, i want to for loop it to verify all the cells in that column
Let me know if any other information is required.
Thanks and Regards,
Sandesh K S
For loop is not the best option here because you usually need to know beforehand how many elements you have and you mention that number of rows can change. It would be better to use while loop:
${row}= Set Variable 1
WHILE True
${elements}= xpath=//*[#id="myTable"]/tbody/tr[${row}]/td[4]/span
${num_elements}= Get Length ${elements}
IF '${elements}' == '0'
BREAK
END
Table Row Should Contain xpath=//*[#id="myTable"]/tbody/tr[${row}]/td[4]/span 1 LOCAL
${row}= Evaluate ${row} + 1
END

How to replace 0.00 values with null in OBIEE12c . my column datatype is number

How to replace 0.00 values with null in OBIEE12c . my column datatype is number
i need to apply it in RPD or as a self servicing report . it is not require for dashboard and prebuild report
You can use a CASE statement in the column formula of the report, e.g.
case "MyTable"."MyColumn" when 0 then null else "MyTable"."MyColumn" end
0 and NULL are totally different things in analytics and what you're trying to do is already conceptually wrong.
If you made 500 this month and -500 last month does NOT mean you did NULL when aggregating both months. You did 0. And that also why you can't use NULL with numerical data types because you can not aggregate NULL.
Please don't force the system to violate all rules of data processing just do pull some GUI stunts.
EDIT: "Show blank"? Well you're supposed to be doing analytics with corporate data and not MS Paint, but here goes: Set a conditional rule on the column where value = 0 and then set a custom CSS style of "display:none". Ridiculous but will do what you want.
The easiest option is to save as a system wide default for that column.
Set the formatting you want and then on column properties click the save as default and save as the system wide default for that column
Both options will work in the front end but the value will still be output if you export data
Conditional Formatting
Create an analysis with the column you want formatting in.
Add conditional formatting where this value = 0
Either set the font size to 0 or use an image and set to image only
Custom Number Format
Set the number format to be #

Calculated field value won't pass through as a parameter in report

I have a report that I already created in which this works. I have three parameters in my first report with a matrix. The matrix column and rows are based off of two calculated fields. The row field is called Time Summary and is basically a time range like follows (8AM-10AM,10AM - 12PM, 12PM-2PM,Etc.) The column field is just days of the week (Monday,Tuesday,Wednesday,Etc.) They were both calculated by a field called 'CreatedDateTime'. The value column is a count of request numbers so we can see when our call center is receiving the most service requests and at which times.
I'm drilling down to a detail report that lists each request and many of the request details. I created an action on the value (count of request) textbox in my matrix report that makes it drill into the detail report. In the detail report I have the same three parameters as in my first report, but I also have parameters for the row and column fields of my matrix (Time summary and day of the week respectively). Here is a screenshot of my text box properties screen in the action tab.
The problem I'm having is that when I run my matrix report and click on the value that I want to drill into, it will drill into the detail report and update the parameter values for the three that are also in my matrix report, but it won't update the parameters for the values in which I selected in my matrix.
Here is another screenshot of what happens when I select a value in my matrix and it drills into the detail report. I have the calculated fields in my detail report too and it filters the main data set based off of the Day parameter and Time Summary parameter. I made a report yesterday very similarly and it worked. I can't figure out why it I can't get this report to work. I'm almost positive it has to do with how I have my parameters defined in my detail report or something with the text box properties and the action. Any help in figuring this out would be appreciated.

How do you show all rows with missing fields in Crystal Reports?

I'm struggling with Crystal Reports suppressing rows whenever I add a field that some rows may not have data in.
I've been able to fix some of the rows and make them show by using the formula:
if not isnull({field}) then {field} else "Arbitrary string to make row display"
This at least fills in the absent field with something and displays the row.
Do I really have to try and identify every field that may have incomplete data for some rows? Or is there some global method to make all rows show no matter what?
Something like: If isnull(ANYTHING) then " "?
you can do right click on the field, then under suppress, click the formula icon beside it and you can input there the conditions.
You can try the following in report options:
Convert Database NULL values to Default
Convert Other NULL values to Default.
This is hidden in File > Report Options. I have used Convert Database NULL Values to default to show 0's instead of blanks for null valued summaries

Browse field data shows value, but displays another value

I have a formula written for a field in Crystal Reports. When i refresh the report, i get a different value from the formula. The required value is always the last value in Browse Field Data dialog for that formula.
Isnt the formula supposed to have only one value as output? why are multiple values shown in browse field data dialog.? Is there a way to retrieve last value of Browse File Data dialog?
My formula looks like below:
WHILEREADINGRECORDS;
NumberVar CODTOTAL;
if {XXX.YYY} = 1 then
( CODTOTAL := CODTOTAL + {XXX.ZZZ};
);
CODTOTAL;
Browse field data shows all the values "CODTOTAL" acquires as a result of that formula and displays a random value amongst the assigned value.
Please help me out. I am amateur in crystal reports.
Any help would be highly appreciated.
~Regards.
First observation should be where have you placed the formula (Details, Footer.. etc).
why are multiple values shown in browse field data dialog.?
Browse field shows the data that is present in the table but in your case you are applying "If" condition of the filed. It can be possible that there is only one record that satisfies your condition.
I would suggest to run the report without the codition, Check the results and apply the condition and check results again.

Resources