I want to use the simple formula:
="FIX_" & [ID]
The issue with this formula occurs when I confirm the calculated function, the formula appears to revert back to:
="FIX_" & ID
The problem is now that these are no longer referencing the [ID] column so the result returns
"FIX_"
for all records. This does work for the first record entered but any other subsequent entries display this error.
Is this a known issue?
The [ ] notation has got nothing to do with it.. [ ] are only required if fieldnames contain spaces.. As you experienced SharePoint will strip those [ ] on save.
why ID is not listed as a usable Field for Formulas
You can not use the ID in a calculated column because on first Item creation the Calculated Column Formula is processed before the item is written to the database and gets its ID.
Thus ID is 0 for newly created items
When an Item is changed/updated the ID is correctly populated and used with the correct value in Formulas.
Work-around is to create a Workflow (which runs after Item creation) that gets the ID and writes it to another field, and use that in your Formula
or have the workflow changes something else in any field so an item update is forced; reading the Title and write it back in the same field will do.
So you only want to display the link in a VIEW.
You can then use HTML/JavaScvript in a Calculated Column to extract the correct ID from the HTML TR table row
and create the href attribute.
Create a Calculated Columns, and set the datatype to Number!
Paste the Formula (as is, including & characters, line breaks will be ignored):
="<div ""style=text-align:left""><a><img src=""/_layouts/images/blank.gif"" onload=""{"
&"var row=this;while(row.tagName!='TR'){row=row.parentNode;}"
&"var ID=row.id.split(',')[1];"
&"this.parentNode.href='v://database//FIX_'+ID;"
&"}"">database folder</a></div>"
Note: the outer div is added because a Number column is aligned to the Right.
This only works in VIEWS! Not on FORMS!
Related
I have a problem with SSRS report builder. Basically what I want to do is to delete a column. I have a report that someone else made and there is 1 column (xxx) that no longer exists in data source tables so I need to delete it.
When I go to query designer and delete this column from the code and run it there, it works. I close query designer window and see that list of columns (fields) is updated now and xxx column is not there. Then, I delete this column manually in designer (default screen) and when I try to run the report, It doesn't work:
"The Value expression for the text box ‘XXXDataField’ refers to the field ‘xxx’. Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope. Letters in the names of fields must use the correct case."
But that field should be already deleted. So I don't know what else I can do, or what it can be linked to. I just want to delete it. Any Idea?
Thank you
If your dataset does not contain xxx but your DataTable has this error is normal
You either delete that column from your table or at lease delete DataSet Binding from table so that SSRS does not try to retrieve that column from DataSet
It will be a reference to the field in another field. For example, if you deleted a column that showed an OrderShipped status, then you might have another text box highlighted based on this.
The error is telling you which textbox is in error. So, click somewhere on the designer, then in the properties window, right at the top, click the dropdown which allows you to choose specific report items, choose XXXDataField (the one named in the error message) and then check the value expression. In there you will find the reference to the column you deleted.
Edited:
Let me try to explain more clearly. I wrote the earlier message in haste:
I have a sub-summary part which is sorted by the parent table's ID field. In this part, i have placed a summary field from the child table ( on which the layout is based ). This summary field is a running total of a number field in the child table , with restart checked. When this field is placed in the sub-summary part, it summarizes the values of all the records below it. Which is fine. What i want is to show that summarized value in each of the records just below the sub-summary. So for instance if the summary field shows a total of 1,000, then i want to show that 1,000 in each child record below in the layout. Then when the next break occurs and the field summarizes the next set of child records in the sub-summary I also want it to show the same value in the next set of records below it. I hope it's a little more clear.
It's difficult to understand what your question is. Some statements do not make sense at all. A sub-summary part is based on a field, not on a table. And a summary field is not "sorted".
If you want to show a running total in the body, without restarting at each break, you must define your summary field so. A summary field does not have to restart in order to show sub-summary values when placed in a sub-summary part.
Added:
A summary field displays the sub-summary value only when it's placed in a sub-summary part. If you want to show the same value elsewhere - or use it in a calculation, you must use the GetSummary() function.
Note that the GetSummary() function will only work if the break field is a local field. If you're grouping by parent, make sure you're using the foreign key field in the child table - not the primary key field in the parent table.
I am working on a SSRS report with a Multi Value Parameter which contains list of names. I have written an expression for the title that works like "Result for SELECTED NAME". It also have an option of (Select All) which displays all the results with title as "Result for MULTIPLE NAME". It is working fine up to this part.
Now I have to modify the report like, If i select multiple values, the report should break into pages with each selected name on different page with title for that individual parameter value(name) as "Result for SELECTED NAME".
Please help me. Thank you.
You can place the entirety of your current report (excluding headers/footers) into a List object. I assume youa re returning the selected values from the parameter (like Manager Name) as part of your DataSet. Assuming this is the case
Create a new list
Insert the contents of your report into the rectangle of this List
Right click the List Row Header and Select Row Group -> Group Properties
Set the Group to Group on
=Fields!ManagerName.Value
This approach will take a simple table like this
And break it into a list like this
Then you can just set the Tablix Properties of the List to Add a Page Break After to checked
Hopefully this is helpful. If you have further questions on this then please let me know
I worked on it and found a way to make it happen. I first created the row group for Names. Then applied the page break for each instance option. Then deleted that group column (Only deleted column but not group). Then added that group in a static column on the top, and wrote an expressions to show that group itself as a title using concatenation.
But here I faced another problem, when there is no data for the selected name, the title row isn't displayed in the preview as it also a column in the table.
I have a list of stock prices for several stocks. Some of the values are missing due to weekends, holidays and probably other reasons.
The gaps are not consistent. Some are two days and some are more than that.
I want to fill the gaps with the last known value but not at the end of the list.
I have tried in Excel to test a few cells below and if it's now empty, do the fill. The problem is that due to the inconsistency of the gaps, it's a tedious task to change the function for all the cases.
Is there a way to test for the end of a list?
UPDATE - added a screenshot.
See this screenshot. I want to fill where the blue dots are. The red dots are at the end of the list and I don't want to fill those cells.
I am looking for a way to detect the end of the list and stop the filling when the end is detected.
I think this is pretty difficult in OpenRefine and probably a different tool would work better. The main issue is that OpenRefine does not offer the ability to easily work across rows so 'summing a column' (or part of a column) is tricky - this is mentioned in https://github.com/OpenRefine/OpenRefine/issues/200
However, you can do this by forcing OpenRefine in Record mode with the whole project containing a single record. Once you've done this you can access all values in a column using syntax like:
row.record.cells["Column name"].value
This gives an array of all the non-blank values in the column. Since this ignores blank values, in order to have a true view of the values in the column you have to fill in blank cells with a value.
So I think you could probably achieve what you want as follows:
For each column you are going to work with do a cell transform to put a dummy value in empty cells - e.g. if(isBlank(value),"null",value)
Create a new column at the start of your project and put a single value in the very first cell in that column
Switch to Record mode
At this point you should have a single 'Record' in your project - e.g.
You can now access all cells in a column using syntax like row.record.cells["Column 1"].value. You can combine this with 'forRange' to iterate through the contents of this array, using the row.index as the marker for the current row.
I used the following formula to add a new column to the project:
with(row.record.cells["Column 1"].value,w,if(forRange(row.index,w.length(),1,i,w[i].toNumber()).sum()>0,"a","b"))
Then...
Change back to 'Row' mode
Remove the 'null' placeholder from the original column
Create a facet on the 'fill filter' column
In my case I filter to 'a'
Use the 'fill down' option
Remove the filter
And remove the 'record' column
Rather a long winded way of doing it to say the least, but so far I've not been able to find anything better while not going outside OpenRefine. I'm guessing you could probably compress steps 5-11 into a single step or smaller number of steps.
If you want to access the array of cell values using Jython as suggested by iMitwe you need to use:
row["record"]["cells"]["Column 1"]["value"]
instead of
row.record.cells["Column 1"].value
(step 5)
I am doing this on the top of my head, but I think your best chance my be using the fill down option in record mode:
first move your column to the first column and switch to record mode.
then use the following GREL: row.record.cells["data"].value[-1] where data is the name of your column
The [-1] will take the last value and fill the blank. For the case with the red dot, since there is no value it should remains empty. Let us know how it goes.
Unless there's something I am missing or not seeing...
I would have just sorted reverse (date ascending) on the Date column, then individually use Fill Down on each column, except for that last column where you could then use a Date facet on your column Date to specify the exact Date range you wanted to work with, then fill down on that last column, then remove the Date range facet.
I have a calculated column named "Link" which is used to show the link (url) of a particular list item. The formula in the calculated column adds/appends the value in the ID column. The formula works for existing items, However when new items are added the calculated column does not contain the value of the ID column. However if I go to the settings of the "Link" calculated column re-write the formula the Click OK the, the formala works and adds the value of the ID column to most recent list item. The problem starts again when a new list item is added in that the value of the ID column is not added and again I ma having to keep going to the "Link" calculated column settings and again re-write the formula.
The formula is the following:
="http://www.sampleweb.com/articles/item.aspx?ListName=Articles%20Bytes&ID="&ID
and the results it produced are the following:
http://www.sampleweb.co.uk/articles/item.aspx?ListName=Articles%20Bytes&ID=44
but again when a new item is added the following is displayed
http://www.sampleweb.co.uk/articles/item.aspx?ListName=Articles%20Bytes&ID=
Does any one have any suggestions as to why the formula does not work when new list items and /or how to resolve it.
Any assistance will be greatly appreciated
many Thanks
I solved similar problem with workflow workaround. It's helpful to use workflow also for later calculation of calculated values...