LibreOffice Calc: How to control which values are incremented on drag down? - libreoffice

I have a complex formula in a cell with various references to other cells.
=INDEX($Sheet1.B1:B100;MATCH(C1;$Sheet1.D1:D100;0))
I want all cell in the same column to have the same formula with only one reference incremented. But if I select the field and drag down the little square all references are incremented.
So the following fields would have the values:
=INDEX($Sheet1.B2:B101;MATCH(C1;$Sheet1.D2:D101;0))
=INDEX($Sheet1.B3:B102;MATCH(C2;$Sheet1.D3:D102;0))
=INDEX($Sheet1.B4:B103;MATCH(C3;$Sheet1.D4:D103;0))
…
But what I need is:
=INDEX($Sheet1.B1:B100;MATCH(C1;$Sheet1.D2:D100;0))
=INDEX($Sheet1.B1:B100;MATCH(C2;$Sheet1.D2:D100;0))
=INDEX($Sheet1.B1:B100;MATCH(C3;$Sheet1.D2:D100;0))
…
That means all matrix should not be incremented, the single reference to column C has to be incremented. How can I do this, where it is not possible to to it manually as too many rows are affected?

Instead of:
=INDEX($Sheet1.B1:B100;MATCH(C1;$Sheet1.D1:D100;0))
use:
=INDEX($Sheet1.$B$1:$B$100,MATCH(C1,$Sheet1.$D$1:$D$100,0))
Place a $ dollar sign before each column and row you don't want changed. That is $B$1 .... $B$100 .......... $D$1 ..... $D$100

Related

SSAS 2017 - IF statement in calculated measure with condition from dim table

I am trying to get sum of fact table column based on dimension table column value. ie.
If Dim_Product[Origin]="A"
THEN SUM(Fact_Connectivity[MONITOR_CNT])
ELSE
SUM(Fact_Connectivity[TLA_MONITOR_CNT]).
I am using below formula:
Adoption %:= IF(Dim_Product[Origin]="A",
SUM(Fact_Connectivity[MONITOR_CNT]),
SUM(Fact_Connectivity[TLA_MONITOR_CNT]))
But I couldn't use Dim_Product[Origin] table fields in the formula even though Fact table has relationship with Dim table.
You can't directly use it in a measure, raw, or using related, you will have to wrap it round with something to determine the row context.
So for example,
Measure = IF(MAX('Dim Origin'[Origin]) = "A"
, SUM('Table'[Monitor_cnt])
, SUM('Table'[TLA_Monitior_cnt])
)
So on a row by row basis It will take the MAX value for that row, then apply the function. AS the row will only have one value the logic works.
You could also move this to a calculated column.
Hope that helps

Adding the totals of two seperate tables in a word document

this question relates to adding the totals of two tables and using that total in the body of the word document.
In my case I have a word document (docx) with two tables. These tables are populated through a word merge process of third party software over which I have no control. For ease of reference I will refer to each table as table1 and table2. Both tables will contain an unknown amount of rows, but the last row, will always contain a total in the last column, which will total the rows above using the formula =SUM(ABOVE).
In the body of the document, I know need to reference the total of each table and because I do not know how many rows there are, I am at a loss. For example, if I knew how many rows there are, I could use the answer given here.
I have tried to using a merge field - with the column names as follows - however I get a !Syntax error ...
=SUM(table1[Amount]+table2[InterestAmount])
Any and all help greatly appreciated.
If you bookmark the two tables (e.g. TblA, TblB), you can use a formula field to tally their totals:
{=SUM(TblA C:C)/2+SUM(TblB C:C)/2}
The reason for the /2 is that, unless you know the last row # beforehand, you need to reference the entire column (including your existing totals row), the sum of which will therefore be twice the total.
To see how to do a wide range of calculations in Word, check out my Microsoft Word Field Maths Tutorial, at:
http://www.msofficeforums.com/word/38720-microsoft-word-field-maths-tutorial.html
or:
http://www.gmayor.com/downloads.htm#Third_party
Fields can be bookmarked in Word, then referenced elsewhere in the document. When bookmarking in a table, be careful to not select the entire cell, only the field! If the entire cell is bookmarked then the cell structures are carried across to the REF and the field content can't be processed numerically.
For three bookmarked fields with the names Fld1, Fld2and Fld3 that should be multiplied the combined field code would look like this:
{ = { REF Fld1 } * { REF Fld2 } * { REF Fld3 } \# "0.00" }
Note that you could also use the PRODUCT function (like SUM, but multiplies, each factor separated using the system's list separator character.)
Notes for readers not familiar with working with Word field codes: the paired wavy braces must be inserted using Ctrl+F9 and cannot simply be typed from the keyboard. Alt+F9 will toggle between field code and field result display. Press F9 to force a field to update.

Libreoffice Calc reference cell with a specific progression

I have a collumn with this contend inside:
=sheet1.F8
=sheet1.F15
=sheet1.F22
Normally in the excel I select the three cells and pull down, excel understand the logic and the next cell above will be "sheet1.F29". But if I do this in Libreoffice it puts "sheet1.F11".
Do you have any idea of how to do this ? (I have several sheets like this logic and I'd like to use Libreoffice instead Excel).
I found a workaround and replying here:
It is setting the reference to “F11” because the first row contains a reference to F8 and the new entry is 3 rows beneath this i.e., the offset is based on the first cell of the selection, thus 8+3=11. A workaround is to use the addresses of the destination and combine this with the INDIRECT() function. For example, create a separate column with “Sheet1.F8”, “Sheet1.F15”, and Sheet1.F22” etc. Highlight and drag this column of values to obtain a column of correct address references. Then adjacent to this use (given “Sheet1.F8” in sheet 2 cell A1) =INDIRECT(A1) in B1. Now drag this down the B column to obtain the required values.

How to lookup table name from cell in iWork Numbers?

I have a spreadsheet that has quite a few tables and I wonder what would be the formula to lookup table name from cell in iWork Numbers? For example I have table with name TableA, inside of that table I want to put something like "=$B1" or whatever to get the name "January01" in it. Just typing it is not acceptable, cause those table names will change for multiple day of the month (we planning to have 30-31 tables in one spreadsheet and have 12 spreadsheets for number of months).
It is possible to use text in another cell to specify a sheet and/or table name in the cell or range address within a formula in another cell.
You can use the INDIRECT function.
"The INDIRECT function returns the contents of a cell or range
referenced by an address specified as a string value."
from the iWork Numbers function browser
Example:
Assume the cells in column A of a particular table contain the names of the sheets in the workbook.
In column B you could count the number of cells that contain the text 'equal' in column D of Table 1 in each sheet using:
=COUNTIF(INDIRECT($A2&"::Table 1::$D", 1),"=equal")
Here the sheet name is specified in column A so the formula can be used for the entire column without having to manually edit the formula to specify the sheet name.
According to this support forum entry that is not possible. Came across it as I was looking for a solution to the same problem.
This is a very old thread, but here is how to get the table name:
You need to use the REFERENCE.NAME function to get the name of the table (plus some extraneous info, that you get rid of by using the TEXTBEFORE function).
TEXTBEFORE(REFERENCE.NAME(SomeTableName::$A$1,1),":")
The entry "SomeTableName::$A$1" is a random cell reference (in this case cell A1) from the table whose name you are interested to get. During formula entry, you merely click on a cell of the table in question to generate this reference, and then lock cell column and row, as needed.
The parameter "1" following the cell reference tells the REFERENCE.NAME function to return the name of the table and the cell name. There is no option to return just the table name.
The TEXTBEFORE function truncates the returned string to everything before the first colon, returning just the table name.

Is it possible to create a row that spans all columns of a Matrix in SSRS 2008?

Is it possible to have add a row to an SSRS 2008 Matrix that spans all of the matrix's columns?
This crude diagram shows roughly what I'm looking for:
The basic idea is that each line item is a person, and each column is a field in a form for that person. The fields themselves are dynamic (and implemented as column groups on the matrix). Additional column groups are included to append non-dynamic form fields, like the time the record was entered and who entered it. Under each person's record is a comments field, which should span all of the form fields above it.
At the moment I have the matrix embedded in another tablix, with the name and fields in the matrix and the comments in the parent tablix. This works for the data (each instance of the matrix ends up being one row), but the header repeats too often (once per person) because it's attached to the matrix. The only thought I have as to how to fix this is to create another matrix in the parent tablix with the same grouping and use it to display the headers... But this will require quite a lot of manual synchronization to keep the two matrices the same.
Edit: The key problem here is making the second row span multiple column groups.
Here's what you can do:
Select the column grouping you want to add above and right click and select
Add Group... Parent Group...
Group the column by something that will not aggregate the data. You'll have to select a field from your dataset to group by so that it creates an overlapping column grouping.
Check the Add group header box
You should now see something similar to this:
Now you just need to move the Value1 field and it's header over under the new column to the right beyond the matrix dividers. Once that's done, simply delete the ungrouped column where you just copied Value1 from and be sure to select Delete columns only checkbox.
Your finished product should look like this:
It is possible - And the above answers are partial answers leaving out one key step: Merging the cells of the child row.
First, right click on your grouped row, then select Insert Row -> Inside Group - Below and you will get two rows with the cells aligning on the columns
Second, ctrl click all the cells in your new row (ie row without the data) then right click on one of the highlighted cells, and then select Merge Cells.
Now you have the table you like. To add a value to the new row: first right click your new (multi column) cell,select Create Placeholder, and then add the dataset item you desire to the placeholder.
[Edit]
After several attempts, I'm going to say this isn't possible in SSRS. The best I could come up with is a group footer that spans columns 1,2, and 3, but not the User column.
[Original Response]
I recently did something similar to this.
First, what tool are you using to create SSRS reports? (I used SQL Server Business Intelligence Development Studio)
You'll want to create a row group (grouped on Person)
Append a row to your table in "Design" view (Right click, "Insert Row --> Inside Group - Below").
Add an expression to the row that pulls the value for your "Comment" column (=Fields!Comment.Value).
Let me know if that helps...
Try adding in you column group "header" with a grouping expression of (1=1). Then a detail field will need to be defined. If you define the other group with correct data then the "header" will stretch across all details columns. You may need to merger depending on other options.
The easiest way to do this is to create a Tablix with only one column, and your row grouping.
Then, you create two rows inside this group.
In the first row inside the group, you insert a Matrix, wich you can then subgroup as you prefer.
I just had a similar problem, and this was my solution.
I banged my head against the wall for a lot of time, until i realized the solution to my problem wasn't "making a cell span multiple column groups", but "making a cell split into multiple column groups".
You can accomplish the goal by using a subreport for each person. The subreport will receive the employee id and create the hierarchy for you. Make sure your subreport column widths match the widths of the parent report.