Boolean to check group if there is 2 exact same values directly after ach other - crystal-reports

I am grouping in Crystal reports and have a field that I am trying to monitor for 2 duplicated values should they follow directly after another at any time. Please see example below :
IDTAG#14567 {Groupname}
Date Device Tagtype MovementType Firstname
01/01/11 08:15am Entry AVI 0 AnnaAVI1
01/01/11 08:25am Entry AVI 0 AnnaAVI2
01/01/11 11:35am Exit AVI 4 AnnaAVI2
01/01/11 12:05pm Entry AVI 0 AnnaAVI1
01/01/11 15:24pm Exit AVI 4 AnnaAVI1
01/01/11 16:00pm Exit AVI 4 AnnaAVI2
I need a 'True' value output only if {MovementType} has 2 value's of '0' followed in direct succession, it doesn't matter when it happens within the group.

To get the duplicate part, a formula that would accomplish it would be
previous({table.movementType}) = {table.movementType}
However then the problem is how to indicate that there were duplicates in a group regardless of where it occurred.
I haven't found a way to deal with that.

Related

Cannot edit numbers document with AppleScript

I am trying to run a very simple script in automator for a the apple program numbers. I have tried a couple of different scripts with no success.
With the following code:
on run {input, parameters}
tell application "Numbers"
activate
tell document 1 to tell sheet 1 to set the value of cell "B3" to 0
tell document 1 to tell sheet 1 to set the value of cell "C4" to 42
end tell
return input
end run
I get the following error message:
"Numbers got an error: Can’t set cell "B3" of sheet 1 of document 1 to 0."
There was a nearly identical posted question with the following solution:
on run {input, parameters}
tell application "Numbers"
tell table 1 of sheet 3 of document 1
set the value of cell 1 of column "E" to 1000
end tell
end tell
return input
end run
but this gives me the following error message:
"Numbers got an error: Can’t set table 1 of document 1 to 1000."
This other post did mention it may have something to do with privileges but did not elaborate and I have been unable to find any more information regarding this.
Can anyone help me please?
Thank you.
With a Numbers document already opened, the following example AppleScript code works for me:
tell application "Numbers"
activate
tell first table of first sheet of front document
set value of cell "B3" to 0
set value of cell "C4" to 42
end tell
end tell
Here is a different way of saying the same thing as the example AppleScript code above:
tell application "Numbers"
activate
set value of cell "B3" of table 1 of sheet 1 of document 1 to 0
set value of cell "C4" of table 1 of sheet 1 of document 1 to 42
end tell
Note: The example AppleScript code is just that and does not contain any error handling as may be appropriate. The onus is upon the user to add any error handling as may be appropriate, needed or wanted. Have a look at the try statement and error statement in the AppleScript Language Guide. See also, Working with Errors. Additionally, the use of the delay command may be necessary between events where appropriate, e.g. delay 0.5, with the value of the delay set appropriately.

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

Zabbix Trigger Expression = NULL

i´ve a quick question regarding a zabbix trigger expression. Our script finds out the certification lifetime while returning a number into a file. I already created some triggers for specific time spans (like 10 days or 44 days).
For example:
{Certificate Lifetime:vfs.file.contents[C:\Zabbix_scripts\cert.txt].prev()}<=30 and {Certificate Lifetime:vfs.file.contents[C:\Zabbix_scripts\cert.txt].prev()}>10
I now want to have a trigger which will cause an "Disaster" when the value in the .txt file is unavailable, like the txt file is empty.
I´ve tried
{Certificate Lifetime:vfs.file.contents[C:\Zabbix_scripts\cert.txt].prev()}=0
But this was not the right sulution. Any ideas?
Moreover we have some machines which are equal to others but doesn´t show any value. Any ideas at this point?
Regards
You should be able to detect empty item value with something like this:
strlen()=0

memcached set not stored

The following step has followed:
telnet localhost 11211
set Test 0 100 10
get Test
CLIENT_ERROR bad data chunk
ERROR
set amit 2 2 2
get amit
CLIENT_ERROR bad data chunk
ERROR
In my case I was providing the value but the bytes were not exactly what I was mentioning in the set command, for the format of the command is:
set KEY META_DATA EXPIRY_TIME LENGTH_IN_BYTES
so for those who were just copy pasting the command without knowing as to why is it not storing the key and came here for the answer, this might help:
You need to provide the value of exactly the same bytes which you have mentioned in the last parameter of the set command
the following won't work:
also the following won't:
So when you enter the value it has to be exactly the same bytes, like this:
Although you do not ask a specific question, i presume you want to store a value.
You could test with the default example from the Memcached manual.
You define that you want to store a key, but don't specify a value.
The following example specifies that you want to save a key "tutorialspoint", no flags, timeout of 900 and reserve 9 bytes for a value. Those 9 bytes are specified in the next line: "memcached". In your example i don't see a value.
set tutorialspoint 0 900 9
memcached
STORED
get tutorialspoint
VALUE tutorialspoint 0 9
memcached
END
‘set Test 0 100 10’, then enter a value which the length is equal to 10。
the set command takes 4 arguments:
key - this is an arbitrary key you'll later use to retrieve the value
flag - use 0 for no flags
ttl - time to live in seconds. this is how long memcache will hold your value.
size - in bytes. Byte count of your value.
In my case I was neglecting to calculate the number of bytes and that was why I kept getting the "client error bad data chunk" error

updating existing data on google spreadsheet using a form?

I want to build kind of an automatic system to update some race results for a championship. I have an automated spreadsheet were all the results are shown but it takes me a lot to update all of them so I was wondering if it would be possible to make a form in order to update them more easily.
In the form I will enter the driver name and the number o points he won on a race. The championship has 4 races each month so yea, my question is if you guys know a way to update an existing data (stored in a spreadsheet) using a form. Lets say that in the first race, the driver 'X' won 10 points. I will insert this data in a form and then call it from the spreadsheet to show it up, that's right. The problem comes when I want to update the second race results and so on. If the driver 'X' gets on the second race 12 points, is there a way to update the previous 10 points of that driver and put 22 points instead? Or can I add the second race result to the first one automatically? I mean, if I insert on the form the second race results can it look for the driver 'X' entry and add this points to the ones that it previously had. Dunno if it's possible or not.
Maybe I can do it in another way. Any help will be much appreciated!
Thanks.
Maybe I missed something in your question but I don't really understand Harold's answer...
Here is a code that does strictly what you asked for, it counts the total cumulative value of 4 numbers entered in a form and shows it on a Spreadsheet.
I called the 4 questions "race number 1", "race number 2" ... and the result comes on row 2 so you can setup headers.
I striped out any non numeric character so you can type responses more freely, only numbers will be retained.
form here and SS here (raw results in sheet1 and count in Sheet2)
script goes in spreadsheet and is triggered by an onFormSubmit trigger.
function onFormSubmit(e) {
var sh = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet2');
var responses = []
responses[0] = Number(e.namedValues['race number 1'].toString().replace(/\D/g,''));
responses[1] = Number(e.namedValues['race number 2'].toString().replace(/\D/g,''));
responses[2] = Number(e.namedValues['race number 3'].toString().replace(/\D/g,''));
responses[3] = Number(e.namedValues['race number 4'].toString().replace(/\D/g,''));
var totals = sh.getRange(2,1,1,responses.length).getValues();
for(var n in responses){
totals[0][n]+=responses[n];
}
sh.getRange(2,1,1,responses.length).setValues(totals);
}
edit : I changed the code to allow you to change easily the number of responses... range will update automatically.
EDIT 2 : a version that accepts empty responses using an "if" condition on result:
function onFormSubmit(e) {
var sh = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet2');
var responses = []
responses[0] = Number((e.namedValues['race number 1']==null ? 0 :e.namedValues['race number 1']).toString().replace(/\D/g,''));
responses[1] = Number((e.namedValues['race number 2']==null ? 0 :e.namedValues['race number 2']).toString().replace(/\D/g,''));
responses[2] = Number((e.namedValues['race number 3']==null ? 0 :e.namedValues['race number 3']).toString().replace(/\D/g,''));
responses[3] = Number((e.namedValues['race number 4']==null ? 0 :e.namedValues['race number 4']).toString().replace(/\D/g,''));
var totals = sh.getRange(2,1,1,responses.length).getValues();
for(var n in responses){
totals[0][n]+=responses[n];
}
sh.getRange(2,1,1,responses.length).setValues(totals);
}
I believe you can found everything you want here.
It's a form url, when you answer this form you'll have the url of the spreadsheet where the data are stored. One of the information stored is the url to modify your response, if you follow the link it will open the form again and update the spreadsheet in consequence. the code to do this trick is in the second sheet of the spreadsheet.
It's a google apps script code that need to be associated within the form and triggered with an onFormSubmit trigger.
It may be too late now. I believe we need a few things (I have not tried it)
A unique key to map each submitted response, such as User's ID or email.
Two Google Forms:
a. To request the unique key
b. To retrieve relevant data with that unique key
Create a pre-filled URL (See http://www.cagrimmett.com/til/2016/07/07/autofill-google-forms.html)
Open the URL from your form (See Google Apps Script to open a URL)