How can I get last value to compare with the new value I want to add? - teechart

How can find the value of the last index in a point or line chart .. so I can compare with the new value to add?
Expect to change the change the colour or a new point if its value is increased or decreased

Related

Get the variable name instead of the value when searching for peak

I have the following problem: I have measured cortisol in different persons and now have a dataframe that shows the respective cortisol value at the different times per test person. Now I would like to determine the maximum value of each test person (the peak), however, I do not only need the value, but above all I would like to know to which point in time this value belongs, i.e. when the cortisol was at its highest. With the code I have inserted here, I can output the maximum value per person, but I would also like to output the time. Can you help me with this?
Many thanks
this is the code I tried:
dataframe %>%
group_by(vp_code) %>%
summarise(max = max(Cortisol, na.rm=TRUE)) %>%
data.frame

Qlikview - show first and last selected value in list

I need to display first and last selected value in list. I have listbox and when I pick date I got this result in list
I want to get in one box min value selected but when I use minString(Data) I got 22/2022 instead 303/202. And for max I need to get 306/2022.
Can anyone help please?
To get the Qlik engine to ignore the selected values you need to set analysis.
Firstly, you should be using a max() not a maxstring(). Max() will evaluate the maximum numerical value. Maxstring() will evaluate the maximum ascii values of the string (I think, anyone can correct me).
Secondly, the value 306/2022 in that list is grey which means it is no longer included in the dataset used for the visualisations being displayed. The white values are the values that are included, this is why min(Date) is returing 22/2022. 22/2022 is the minimum available (white) value in that list. 303/2022 is the minimum value of the excluded values in grey.
If you want to be able to reference the values even when the selections have caused it to be excluded (turned them grey) you need to modify your max() to max({1}).
{1} means look at all the data not just the selected data.
max({1} Date)
will return 306/2022 no matter what the selections are.
If you want to return 303/2022. The minimum of the excluded values and have that change dynamically when making other selections let me know and I can show you but I will require you to explain why you would want to that before I try figure it out :)
You can try using the OnOpen document trigger.
enter image description here

Script for copying and pasting value only (GOOGLE SPREADSHEETS)

I have the following idea I can't implement:
There is a row with given table plate numbers (column B) and there is a second row with names which are copies by "vlookup" formula from another spreadsheet and in case there are no numbers found, the text should be filled in manually. I have added the formula which leaves cells blank:
=if(isna(index('spreadsheet1'!A4:A1002;match(B16;'spreadsheet1'!B4:B1002;0)));"";index('spreadsheet1'!A4:A1002;match(B16;'spreadsheet1'!B4:B1002;0)))
But sometimes the person assigned to a car plate changes and thus, after taking this value, I have to make as easy as I can to paste values only (the problem is the person who will add data may make mistakes) - I have created a button and want to assign a script which will check if the value in the column B has a name (not empty =""), then it should copy it and paste value only at the same place but all other cells which will be empty should stay with formulas inside them for further addition of a person to a new plate number or to be added manually.
Every new column will be filled in one by one and would like this script to work for constantly. Do you have any ideas or hints how I can implement it?

get inserted key in redis

I am using this code:
sadd my_set "el1"
to insert "el1" into my_set. sadd only returns the number of inserted elements. What I need is the key of the inserted element so I can retrieve it later. I am sure there is a way that I am not aware of. Is sadd the right function or I should choose something else like set/get?
EDIT: I need something like auto_increment key in mysql. When I insert something, get the last inserted element for further use.
I need something like this:
key: 1
value: {"name": "jack", "tel": "12412415"}
so I could get the array using key = 1.
To do something vaguely similar to "auto_increment," I would look at the INCR function:
http://redis.io/commands/incr
It will increment a value, returning the new value to you - and it is atomic (like most/all Redis commands), so you don't need to worry about threading issues. So your steps would be something like:
SET an increment key.
When you want to add a value, INCR the key, and SET your new value using the value INCR returned.
INCR has at this point increased the value of the increment key, so any repeated value insertions will use the "next" number.
If you want to store a list of items which can be looked up by index, you probably want to do something like this (in programming pseudocode):
// When you initialize your database for the first time.
SET index "0"
// When you want to insert a new item:
INCR index
SET myList:(index value) "My Value"
// When you want to retrieve an item, and you have the index for it:
GET myList:(index value)
In this example, I'm assuming that in your program you are keeping track of the values returned by INCR. The value INCR returns is going to be the index at which you insert the new item, as well as the index with which you'll look up your item later. So, in my example code, replace (index value) with the stored value you got back from INCR (how you do this depends on what programming language you're using, of course).
Note that this DOES allow deletion of items in the middle, via DEL myList:(index value), because you're tracking the last index with index, so even if an item is deleted, the last index will still remain the same - this behaves very similarly to "auto increment" fields in most SQL servers.
You really don't want to use sets for this; sets are inherently unordered, and they are not really made to look things up by "key" - items in a set don't even really have a key. Sets are more useful for the other set operations you can perform on them, like SINTER or SDIFF.

How do I reference the last filled in cell in of a column in Apple's Numbers app (OS X)

I need the footer of a table in Numbers to calculate the difference between the first value in a column and the last value in a column. The last value may be greater, or smaller than the first. How do I reference the last filled in value of a column?
If you don't have empty cells between the first and last entry, the last entry can be found using COUNT, and retrieved using OFFSET. Example :
=OFFSET(A$1, COUNT(A)-1, 0)
the difference between the first and last would then be something like:
=OFFSET(A$1, COUNT(A)-1, 0) - A$1
Rather than counting forwards from the first cell as Alexandre's answer does, OFFSET can count backwards from the current cell. I have found this more reliable.
So for example, if your total/difference is in cell A23, and the last cell is immediately above it, you could reference it using:
=OFFSET(A23, -1, 0)
This will continue to work correctly when rows above are inserted or deleted - it will always reference the cell immediately above.

Resources