MS Access - Right Align Formatted number on a Form - number-formatting

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.

Related

Calculating % Complete

enter image description here
From the Image I need to calculate % complete for the order number 1.
Calculation for complete will be
(total number of points for status 'Delivered' / total number of points)*100
The value should be 57%
Can some one help with the calculated field?
Look at IIF in help files
SUM(IIF([Status]="Delivered",[Point],NULL)) / SUM([Point])
I assume your column named Order No. extends all the way down each row (i.e., each row should have a 1 as Order No. but the screenshot does not show that.
Also, the above only works if the status of "Delivered" is consistently cased, which it is not in the screenshot. If it is not consistently cased, wrap [Status] in an Upper function:
SUM(IIF(UPPER([Status])="DELIVERED",[Point],NULL)) / SUM([Point])
You can also get the effect you want, just by manipulating the Tableau user interface -- without needed to write calculated fields as #S. User18 showed. Both approaches work, but it helps to understand both alternatives.
As with #S. User18, I assume your column named Order No. is consistently filled in. I also assume [Order No.] is a dimension.
Place [Order No.] on a shelf, say Rows
Place [Status] on another shelf, say Columns
Place Sum([Point]) on a shelf, say Text
This shows the sum of the number of Points for each combination of the two dimensions: [Order No.] and [Status]
To convert the number of Points to a percentage, right click on Sum([Point]) on the marks card, and choose Quick Table calculation->Percent of Total
Similarly, right click on Sum([Point]) and experiment with different "Compute Using" settings to get the effect you want -- i.e. percent of each row, column, table etc. You can instead Edit the Table Calc if the preset Compute Using options don't get the effect you want.
Right click on any row or column headers that you want to hide - so if you only want to display the percentages for the Completed Status, hide the others. Don't exclude the others as that will change the calculations.
To understand more about Table Calculations, see the online help.

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

Is it possible to determine the current rendering position in Crystal Reports?

i would like to create a conditional keeptogether property depending on the space left on the current page, is it possible to get this value from within a formula field?
my goal is a visual clean report without wasting to much space, i already read about a method where you keep track of your position with a linenumber counter. unfortunately i cant use this approach because my lines vary heavy in height because of a note field which holds from 0 to 25 lines.
This is going to sound like a ridiculous and tedious suggestion, but it's the only way I know of making this work. You'll need to use that process of line counting (basically, keeping a running total of how many lines have been printed) that you heard of with one modification: calculate the number of lines Notes needs by the getting the length of that Notes string and dividing by a pre-determined count, which you'll need to do visually, of how many characters are in a line and make the result the line's line count in the overall formula. It's not going to be exactly right because there is no way to make it exactly right, but it will be close. Does that makes sense or do you need me to go into exact detail of how to do this?

Open Graph number aggregation doesn't show decimal places for float

I'm trying to create an aggregation for my open graph action using the number layout. It needs to have two decimal places. My object, 'location', has property 'rtw' of type Float.
In the create aggregation screen in the number field I have {location.rtw | currency} which should format the float to 2 decimal places according to this document: https://developers.facebook.com/docs/opengraph/template/
However it seems to round it instead of showing decimal places, so my float of 1.54 becomes 2.
Am I doing something wrong here?
The Open Graph offers a choice of Layout Styles for aggregations:
The Open Graph Layout Style called "Number" - the layout you have chosen - always display the aggregation in its headline as an integer. This is by default and can't be changed. It appears to be an aesthetics-based choice on Facebook's part.
The headline aggregation can be a sum, min or max value, but even if the individual values are of type float the aggregation will be of type integer.
See this screenshot example, taken from the Layout style section of the Define Aggregations page on Facebook Developer. The sub-items that can be displayed as part of your aggregation display float values but the Headline number displays an integer:
Here, the total distance run 82.42 (45.06 + 25.56 + 11.8) is converted to the integer 82 in the headline sum, although each individual distance run is a float.
Net, if a developer chooses the Number Layout Style, he has to make sure that the aggregation makes sense in integer form.
There is the option to add a caption line to the aggregation which can contain a float, e.g "ran 82.42 miles in 10 hours".
The individual posts you make with your app can display a float in its headline. E.g. "just ran 25.56 miles in 3 hours".
You can explore the other Open Graph Aggregation layout styles if it is important for you to display a float in the headline. For example, the Map Layout supposedly supports displaying a float in its headline (here displaying a max value):
If the property name is rtw you should only write:
{rtw|currency}
It would be nice to have some more number formatting though. The default display of floats changed a few weeks ago as well. It used to round automatically, but now shows 2 decimals.
My movie rating app used to show 3/5 stars or 2.5/5 stars, but now shows 3.00/5 stars or 2.50/5 stars.

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.