How to reach the end of a chain of cells - libreoffice

I have a file with two sheets:
sheet_A
A B
1 Mr. Joe USD
sheet_B
A B
1 =sheet_A.A1 ???
sheet_B.B1 shall show the value USD. I know i could get it easily with =sheet_A.B1 but I do not want that.
If I enter into sheet_B.B1 =ADDRESS(ROW();COLUMN()-1) I get the output $C$1 and with =INDIRECT(ADDRESS(ROW();COLUMN()-1)) Mr. Joe.
How can I "navigate" through a chain sheet_B.B1 - sheet_B.A1 - sheet_A.A1 - sheet_A.B1?
Edit 1
Maybe I need something like this
=OFFSET(FORMULA(ADDRESS(ROW();COLUMN()-1);0;1)#
sheet_B.B2 shall show the content of sheet_A.B2 in relation of the value in sheet_B.A1

Here are two possibilities. Either formula produces USD in sheet_B.B1.
=INDIRECT(ADDRESS(ROW();COLUMN();;;"sheet_A"))
=VLOOKUP(A1;$sheet_A.A1:B1;2)
Documentation: ADDRESS, VLOOKUP.
EDIT:
One more idea: The following produces the string "=sheet_A.A1", which could be parsed for the sheet name and cell address. Perhaps you would like to use it to refer to sheet_A.B1.
=FORMULA(INDIRECT(ADDRESS(ROW();COLUMN()-1)))
However, as I commented, there is probably an easier way for what you are trying to accomplish.
Documentation: FORMULA.
EDIT 2:
Here is the formula you requested. It uses REPLACE to remove = at the beginning of the string.
=OFFSET(INDIRECT(REPLACE(FORMULA(INDIRECT(ADDRESS(ROW();COLUMN()-1)));1;1;""));0;1)

Related

AS400 Macro, input fields count

5250 emulator:
Hello everyone, I want an operator which will count that input fields as it is shown on attached picture. In this case i have 5 input field.
Thanks in advance and best regards
It can be done!
Download this source: http://www.code400.com/ffd.php
You can comment out the GETKEY section from FFDRPG as you won't need that and it will probably cause it to fall over anyway.
Also, rememember when you use the command, to put the record format name in as well as your display file name - don't just leave *FIRST in there or you'll just get the fields from the first record format in the display file.
EDIT:
You'll need to add an extra field to the ListDs data structure:
D ListDs DS
D SfFld 1 10
D SfType 11 11
D SfUse 12 12
D BufferOut 13 16B 0
D FieldLen 21 24B 0
D Digits 25 28B 0
D Decimals 29 32B 0
D FieldDesc 33 82
If you add the 3rd field SfUse, you can check whether it contains 'I' so you only count Input Capable fields.
Check out the QUSLFLD API https://www.ibm.com/support/knowledgecenter/en/ssw_i5_54/apis/quslfld.htm if you want to see exactly what information can be retrieved by this API.
The example in the download uses the most basic format FLDL0100 but more information can be retrieved if you ask for format FLDL0200 or FLDL0300 but they will take longer to execute and you shouldn't need the extra info to achieve what you're after.
I'm not sure if this is possible, but you might find some joy with the DSM APIs.
QsnQry5250 has a maximum number of input fields return parameter, but it may just show you the maximum allowed on the display rather than the number you have on your screen.
There's an example here https://www.ibm.com/support/knowledgecenter/en/ssw_i5_54/apis/dsm1g.htm
And the API documentation here https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/apis/QsnQry5250.htm
Sorry I can't be of more help - I've never used those APIs and can't think of another way to achieve what you're after.
If you tell us the reason you need to know the number of input fields on screen, we may be able to suggest another way to achieve what you want to achieve.
Damian

Crystal Reports XI - Only show Details lines ending in 'C'

Hopefully a straight forwards question.
I have a Report that runs from a stock system, it prints to show all the products in a customers order, as well as a general 'Thank you for your order..' message.
In the details section it currently shows Product and Product Description for everything within that order.
I have a new client though who wants another version of this report, one which only shows the details lines where the Product Code ends in the letter 'C'.
I'm guessing I need to suppress the details section but I'm not sure what Formula I should be using.
I also can't say for certain that all their product codes will remain the same length. I think about 95% of them will be 8 characters, but any 'special edition' versions may have extra characters in.
Thanks in advance for your help.
A suppression formula needs to return a Boolean value, so a formula checking the last character in your Product Code field should do it:
right(trim({ProductCode}),1) = 'C'
To make it work for a single client, you could do something like this (warning: I'm rusty with Crystal syntax - take it with a grain of salt):
IF {CustomerCode} = 123
THEN right(trim({ProductCode}),1) = 'C'
ELSE false
right(trim({ProductCode})) <> 'C'

How to send email to multiple addresses in range of cells that updates weekly?

I am a novice at programming. I have setup a google spreadsheet that will send a weekly email reminder to those who have upcoming assignments. The spreadsheet automatically pulls the 4 email addresses of those who are assigned each week and places them in A1, B1, A2, B2 (i.e. A1:B2). I want the script to find the 4 email addresses (that change each week) and send the same email to all four of them.
When I hardcode the cc recipients into the MailApp line, it works fine. But because the recipients list changes weekly I want to reference the cells A1:B2 instead. When I try to do that, I get an Invalid Email error. The debugger shows that var ccrecipients is picking up the right cells, but I think the problem is that it returns it as an array instead of as a string. That's as far as I'm able to reason through it.
A few snippets of my code:
var ccrecipients = sheet.getRange('A1:B2').getValues();
MailApp.sendEmail(recipients, subject, "", {htmlBody: message, cc: ccrecipients});
Thanks in advance for your help. I've relied heavily on these forums to put together the code that I have. I've always been able to find an answer, until this one. Thanks!
Your observation is almost correct, sheet.getRange('A1:B2').getValues(); return an array of arrays, something like [[A1,B1],[A2,B2]] A & B representing the values in the cells to simplify my example.
And what you need in the end is a "flat" string with all the needed recipients separated by commas "A1,B1,A2,B2".
The simplest way to do that is to flatten the whole thing,that will create a string with comma separations and that's exactly what we need.
sheet.getRange('A1:B2').getValues().toString();
That should do the trick ;-)

Crystal Formula to exclude if value does not contain a certain format

I'm trying to exclude any value from a certain field (table.value) that does not match this format AA#####A. Example if they entered APT12345T, or PT12345PT and No Value then I want to exclude it from the report. It needs to match example AP12345P. What selection formula can I use to accomplish this.
Any help is greatly appreciated
Thanks in advance.
try reading Crystal's help topics on the mid() and isnumeric() functions.
here's an example from the help file:
Examples The following example is applicable to both Basic and Crystal
syntax:
Mid("abcdef", 3, 2)
Returns "cd".
so, in your case, you want to strip your value into three pieces,
mid(table.value,1,2)
mid(table.value,3,5)
mid(table.value,8,1)
and build up a three-part boolean variable where:
the first piece is not numeric(), or between 'AA' and 'ZZ', or however
else you want to test for letters,
the second part isnumeric(), and
the third part passes the same test as the first part.
where are you getting stuck?
something like this:
not isnumeric(mid({table.field},1,2)) and
isnumeric(mid({table.field},3,5) and
not isnumeric(mid({table.field},8,1))

ssrs expression to split string possible?

so in my query i have select columnx from tblz
it returns 001.255556.84546
I want to be able to split this via '.' and put it into three columns.
column1 = 001
column2 = 255556
column3 = 84576
is this possible?
For info, in 2008 these dont work, you have to do the following:
=Split(Fields!returnedValue.Value, ".").GetValue(0)
Create three calculated fields with the following expressions:
=(Split(Fields!columnx.Value, ".")).GetValue(0)
=(Split(Fields!columnx.Value, ".")).GetValue(1)
=(Split(Fields!columnx.Value, ".")).GetValue(2)
I'm not sure it works or not, maybe give it a try. You might need to use IIF() statement to check values before getting them.
In SSRS you reference the field name, tell it the delimiter to use. Since you are not assigning to a variable, per se, you then need to tell it which part of the split string to use. In your example
=Split(Fields!returnedValue.Value,".")(0)
=Split(Fields!returnedValue.Value,".")(1)
=Split(Fields!returnedValue.Value,".")(2)
You would replace returnedValue with whatever the actual field name is, and place each one of those into your columns 1 - 3, respectively.
This answer was originally posted in the question instead of being posted as an answer:
=(Split(Fields!columnx.Value,".")).GetValue(0)
=(Split(Fields!columnx.Value,".")).GetValue(1)
=(Split(Fields!columnx.Value,".")).GetValue(2)