Crystal report to rounding - crystal-reports

I have a currency field in my report that displays some values. I then do a summary of these values and it gets rounded off.
For eg., if my summary value is 40.706 it gets rounded to 40.71 which is fine, but when my value is 40.704, it gets rounded as 40.70 (this is correct according to rounding principles) but I want it to show as 40.71 since it is a currency.
Is there a way to do this ?

Try to add a 0.004 (or 0.005 if you want also that happened for 40.700) to you original value then round it.

Related

MS Access - Right Align Formatted number on a Form

If I use Standard format for a number in a control then I can Align Right and it appears on the far right of the control in the Form. However, I am using numbers in millions and so want to format the number so that, for example, 50,123,456 will appear as 50.123. So I use format #,,.0 with decimal places set to 3. If I set alignment to left, it aligns to the left of the field on the form, Align Center and it appears in the center. But Align Right and there is a large space to the right of the number, like padding. Is there a way to get the formatted number to hit right up to the right side on the form?
Replace the ControlSource with the expression:
[Amount]/1000
Set property Format to: Fixed
Set property DecimalCount to: 0
The formating option might not be the right approach to getting the needed solution. Do the following instead
Put the format to general number.
Put the decimal places value to 0.
Then go to VBA and add the following code to the after update event of the control
Private Sub allocatedamount_AfterUpdate()
Me.allocatedamount = Left((Me.allocatedamount / 1000000), 6)
End Sub
In this case i added the code to the after update evnt of the control on the form named allocatedamount
I have attached two images.
This code will work for numbers between 10 million and 99 million, where it is between 100 million and 999 million you will have to add another zero to the constant 1000000 used in the VBA code,so that will entail using an If statement to first determine if the value is between 10 million and 99 million or 100 million to 999 million.

Linking sliders in Netlogo so their cumulative value always remains 100% or less

I looked but could not locate any Netlogo code that links a set of sliders that, as one increases in value the other sliders decrease so the total value never exceeds 100% (even though the total can be less than 100%). Has anyone ever tried this?
Thanks
Rudy
You could implement it with something like an 'Update sliders' button, where you set the values you want for all the variables, then press the button and that calls a procedure to adjust them all so they add to no more than 100%. But sliders adjust either because the user adjusts them, or the NetLogo code says something like set variable-name new-value and that code is called in some way.
In practice, if I have multiple sliders that I don't want the total to exceed something, then I have a line at the start of the go procedure that checks the total and stops with a message if it's too high.

How do I display the total percentage and count together as a stacked bar chart without formatting all data to percentage values?

I asked this question (and this question) recently, and even though both have solutions, I am left with a new dilemma because each solution only works on an independent level (i.e. one solution won't work if the other solution is in place).
The problem is this: In Tableau, I discovered that by opting to display the data as a percentage of the total row value Analysis > Percentage of > Row, it resulted in the count value also being displayed as a number between 0 and 1 (i.e. percentage format, because of the aforementioned percentage-only setting).
Is there a way to achieve a 100.00% stacked bar which shows both percentage AND count, and which also isn't formatted to display all data as a percentage of the row total?
The screenshot shows what happens when both solutions are in place. Original screenshots are available within the body of each of the previous questions.
Note: I feel that the right way to go about it might be to normalise my data (bringing all values to a scale between 0 and 1), but being new to Tableau, I am not sure how this is achieved. If this is correct, I would appreciate a walkthrough.
Right click on the second SUM({Number of Records]) pill on the Label shelf, and clear the table calc. Edit your label if needed

Crystal Reports 8.5 decimal values does not show

I have a problem that my crystal report shows the decimal values as 00 every thing is fine but it does not display proper value
e.g.
If i have 0.235 it shows 0.000 If i have 2.356 it shows 2.000
Whats the matter behind it the database field is text based
You are facing this issue because your rounding is set to 1.
Right Click on field.
Click on Format Field.
Go to Numbers Tab.
Click on Customize
Under Number Tab Change Rounding To 0.001 or of you own desire.

Create a Crystal Report cross-tab 'header' label

I'd like to create a 'header' label that 1) is centered over the cross-tab and 2) grows with it. Unfortunately, CR 2008 (or earlier for that matter) doesn't have this feature.
In image (below), I've added a text field above the cross-tab, but I can't think of a way to get it to grow/shrink (horizontally) with it.
If you're able to calculate, say by a summary function, the number of columns you will have then you can do this:
In your crosstab, check to see the width of your columns. The columns should be set widths. Edit: The crosstab adds some padding, so you will have to figure out the column width by measuring in Crystal with another field and eyeballing until it's close enough to work
Right-click on your label, and hit "Size & Position".
Add a new formula for the "Width". The X,Y positions should stay the same.
Use the summary function (You could create a SQL Expression or formula that only shows the month/year of your date fields and then distinctCount() them) to find out how many columns you will have multiplied by the width of each column. This will take some trial and error for sure, but I don't see why it wouldn't work.