I have two tablix in my report(SSRS 2005). I want to subtract from two different columns. I use the following :
=Math.Round(Sum(Fields!LY_Sales.Value, "Ds1"))-Math.Round(Sum(Fields!TY_Sales.Value, "Ds2"))
For display of the columns i use the following:
=Format(Math.Round(Sum(Fields!LY_Sales.Value)),"#,##")
=Format(Math.Round(Sum(Fields!TY_Sales.Value)),"#,##")
sample display value :
seperate columns : LY_Sales - 40,240
TY_Sales - 86,983
Difference value : -47406
this does not show the actual difference, there is slightly difference in the value. Also i want to remove '-' symbol if it's negative i just want to show the difference. How can i resolve this
Can anyone help me to do this...
Thanks in advance ..
this does not show the actual difference, there is slightly difference
in the value.
I've done some testing and could not reproduce your issue.
If you are testing in BIDS, I would advise to delete the cache as this could be a potential root cause.
Also i want to remove '-' symbol if it's negative i just want to show
the difference.
You can do this with the Abs() function, which returns the absolute value of your input.
Your original expression would become:
=Abs(Round(Sum(Fields!LY_Sales.Value, "Ds1"))-Round(Sum(Fields!TY_Sales.Value, "Ds2")))
Related
I have a group column in my report which I need to show/hide based on a parameter value. Since it's a group column, "Column Visibility" is disabled. I tried setting the "Hidden" property to true, but that leaves a white space which I don't want.
Can anyone please suggest me a solution for this? I tried for various solutions over the net, but none worked for me. Attaching a screenshot on the same.
Unfortunately, you're going to need a different strategy.
Changing the visibility isn't going to work without leaving the blank space and you can't make the entire column not visible because it's the main grouping.
Can you use a different column for the group so you can hide the Amount Received Date?
Or use an Expression to change the column to a different field?
I created a report that works great.
Does anybody know how to format this properly without changing the rest of the columns? See red box. The answer should be 0.01.
I changed the format to decimal but it changes all the columns and I need the other columns to be whole numbers and the Amount OB column to be able to have decimals.
You can do this numerous ways with an RDL. One way is to set the text box properties, on the Number tab. Or you could do this in the expression of the value like so:
=FormatNumber(Fields!Weight.Value,2)
If you need to round the number you can also do that in the expression like so:
=Round(Fields!Weight.Value,2)
After spending hours figuring this out. I got the solution. I added the following expression in the total box for the Amount OB column.
=iif(Fields!MeasureDesc.Value= "Amount OB",
Format(SUM(Fields!MeasureCount.Value),"N2"), SUM(Fields!MeasureCount.Value))
This reads if the column equals Amount OB then use two decimal places else just sum the MeasureCount. MeasureCount are the cells that are under Amount OB.
I have searched for a solution but I can't find one suitable on this problem.
I have a chart in access where the Y-axis is text but starts with a number, so up along the y-axis i get this:
I know why, but I don't know how to fix it.
They all have an ID which is fine. I can chose to put the ID on the Y-axis, but then the kW range can't be visualized.
How is this changed?
Changing the text to number is not possible as it needs to be like "a-b kW".
Thanks in advance.
For those who might get this problem, I found out why.
When selecting the data, it chose to use the "Total" function, and "Avg" because that is what the values are. (The picture below says "Group By" but it was automaticly set to "Avg". I just forgot to change it when i snipped for stack.
That results in:
But if i remove the "Total" function i get this:
So, removing the "Total" function works here...
In your query, can you sort by ID, but not display it (e.g., in the query designer, sort 'descending/ascending' on the ID field, but clear the 'display' check box)?
As an aside, I've always had a tough time with Access charts... on my last project, the customer wanted a rather complex bar chart, and I ended-up drawing and resizing rectangle objects to get the look that the customer wanted.
I have created an SSRS 2008 report containing 3 groups and a single detail line. Everything works correctly except when a value in the detail line is equal to the one in the detail line above in which case it is blank. All of the group totals are correct in that they include all values including the ones that are not showing up. I have tried modifying the report by replacing all of the cell expressions with =Fields!Bal0.Value + Rnd(). When I do this all of the values appear since (I assume) they are no longer equal to the value above.
Thanks in advance to anyone who can shed some light on my problem.
SSRS text boxes have a hide duplicates attribute. In my case it was set to the name of the dataset. I changed it to "None" and this fixed the problem.
Background info:
I was handed a "Tool", which was made using MS-Access 2007, and asked to add some things... The tool is basically a collection of options for querying a database. On a form titled CreatedReport there is a listbox that is bound to a table called analyzed which has all of resulting data from the query/queries that ran. The original creator of this tool set the column widths to specific values but with the new collection of possible results, those widths are very far off.
Desired Outcome:
The final result I want to achieve is, of course, to have the columns be the correct widths for the info that is in the columns. As long as that is achieved, I really don't care which route I have to take to get there.
Question:
How can I get the columns in a listbox in MS-Access 2007 to be sized appropriately for each use? Is there an auto-size feature I haven't stumbled across yet or do I need to hard code the set of column widths for each group? This wouldn't be too hard to do since there would only be about 4 or 5 different groups but I would prefer for the process to be automatic if at all possible.
Another approach would be to have the results returned in a sub form datasheet view, then the user can adjust the column widths also to set the widths automatically use code like this:
Example
This example takes effect in Datasheet view of the open Customers form. It sets the column to fit the size of the visible text.
Forms![Customers]![Address].ColumnWidth = -2
You could put this code into the Current Event of the sub form.
I don't think that Robert Harvey's answer is actually responsive to your question.
What you need to do is:
calculate the maximum length of the values in each column,
AND
figure out, based on the font in use, how wide the column should be.
Note that you may not actually want to set it to the maximum width if the value exceeds a certain threshold.
I don't know to do the second taks, but I suspect Stephen Lebans has already done the work on it. You might want to search his website for it.
Last time I checked, you still had to write code for this.
Your best bet is to use a resizer someone has already written. Here is a good one. It's old, but it shoul still work:
http://www.jamiessoftware.tk/resizeform/rf_jump.html
This is a quick solution that should help when you want to set up listview columns of different widths, and you know in advance the widths you want (eg, you know that column X will always be a 2-character State abbreviation, and column Y will always be a city name).
Just supply all the widths as a single semi colon-delimited string. Code each width as a number and a unit, such as 'in' or 'cm'. This worked well for me: Me.lsvPayHist.ColumnWidths = "1.0 in;0.8 in;1.0 in;1.0 in;2.0 in"