Delphi TChart using AddNullXY and trend function - delphi

I have TeeChart version 7.07.
I have a chart with a FastLineSeries with 400 datapoints (x is date and y is used%).
the first 200 are valid dates with actual measured % values. the next 200 are valid dates in the future with 0 as the YValue that were added using AddNullXY (date,0,datelabel). I also have a FastLineSeries as a trend function with a Datasource of the first series.
The problem is the 0's in the last 200 values are changing the trend line. I want the trend line to extend into the future dates where I can predict the date the disks will fill up. I have tried the IgnoreNulls property but it was no help.
Is this possible?
Steve...

Try using NaN instead of 0.

Related

Time difference With 0 Values

Im having a problem in google sheets. I want to sum 2 columns the time that a driver is driving without the stops. So im using this formula to do it:
G7 is 10:20 value and H6 is 10:00.
But I want to do it in all the lines, but when I use the same formula:
I get this value:
Any idea how can I ignore the zero values that are making my database giving me wrong values when in this example the result I want is 00:40. The time driving without the unloads?
use:
=TEXT(SUMPRODUCT(IF(G7:G20="";;G7:G20-H6:H19)); "[h]:mm")

Google Sheets - Creating a line chart with average closing prices over last 90 days?

I've been trying to create a dataset for a chart all day and its way beyond me so hopefully someone can put me out of my misery!
I'm trying to create a line chart of average closing prices for a list of NYSE stocks over the previous 90 days. To build the chart, I believe I need a column of average prices and another column of dates. I should be able to create the chart but I've completely failed at creating the dataset. All I've managed to do is cook my processor.
I have a Column (A2) of NYSE Tickers, and I've tried to build a matrix of prices per Ticker, per date which has taken 2 separate ARRAYFORMULA() functions.
I'm hoping there's a way to process all the data within 1 ARRAYFORMULA() and output the average price per date into each cell, but anything is better than what I've been trying.
Here's some sample data:
NYSE Tickers
HZON
VGAC
BSN
DMYD
SNPR
THCB
(They won't all have data going as far back as 90 days)
Ideally, the output would be:
Avg. Price
Date
$10.11
27/02/2021
$10.08
26/02/2021
$10.02
25/02/2021
(Average price of all NYSE Tickers in my A2 column for that date)
I hope this is possible and someone can help!
Thanks
UPDATE
The dataset is just input manually by me. Pretty much everything about my trial and error attempt is useless. But, I was using this to return historical close prices:
=IFERROR(INDEX(GOOGLEFINANCE(CONCATENATE("NYSE:",$A2), "close", DATEVALUE(B$2)), 2, 2), "")
I'll try to demo what I was trying to accomplish: (best read from inside-out).
Output each average price+date to new rows {
-- For each day (X) - going back 90 days from today {
---- Get average price of array {
------ For each Ticker (build array?) {
-------- Get close price of Ticker on (X) date {

Create Chart Showing Trend for Binary Outcome Variables Vs Date in Google Sheets

I have a dataset with several hundred rows showing whether I completed tasks on a given day. For both task1 and task2, I would mark a 1 if I did and 0 if I did not. An example of 5 rows is below.
Date task1 task2
1/1/20 1 0
2/1/20 0 0
3/1/20 1 1
4/1/20 1 1
5/1/20 1 1
...
I'm looking to create a chart that would have the date on the x axis and the two variables on the y. Then using two different colours (green for 1 and white for 0) I would see how often I completed each task. I would also like to label the different parts of the chart to show the total days in a row that the tasks are completed (or not).
An image below gives an idea of what I want it to look like (note I have much more data than 3 obs per a month)
Not yet an answer, but I've started to get it resolved. I've got the value of each run identified.
See a very rough sample sheet here:
https://docs.google.com/spreadsheets/d/1qq1XRLNFIGunbwqhy5o-zP6NZbaEVFfvLGIRhOquxo4/edit?usp=sharing
Column H has the values for each run (for Task1) - positive for a run of "1"s, and negative for a run of "0"s. Haven't figured out how to plot them both on the same line.
The conditional formatting with green highlighting flags each row that needs to be plotted, due to a change in the run value.
I'll see if I can generate a chart from this...

Reformatting the array of a "Date/Weight" chart to make it an "Age/Weight" chart

Spreadsheet
I have a spreadsheet that tabulates and charts weights that were taken across various dates. I have expanded that to an array that plots the original Data sheet values on an expanded Date column - as can be seen on the Chart 2 sheet.
What I am wanting to do now on Chart 3 is plot the same weight data into an array that has Age in days replacing the Date column - as can be seen. I had thought this was a simple process, but I cannot figure it out.
Looking at the column for "Angel" I have determined that the offset for her data is 609 - meaning that cell T609 should contain the data in cell H4 as she was 675 days old on the day of that weighing. I had a misunderstanding that I could OFFSET column H down 605 rows, but I've discovered that's not how the OFFSET function works. :(
this solution is able to handle positive and negative offset
=IF($G$4-VLOOKUP(T2,$B$2:$C$24,2,0)>0,{ARRAYFORMULA(REGEXREPLACE(TRANSPOSE(SPLIT(REPT("♂♀",
(INDIRECT(ADDRESS(MATCH(INDEX(H4:H,MATCH(TRUE,INDEX((H4:H<>0),0),0)),H:H,0),7,4))-
VLOOKUP(T2,$B$2:$C$24,2,0))-4-66), "♂")), "♀", "")); H4:H},
{ARRAYFORMULA(REGEXREPLACE(TRANSPOSE(SPLIT(REPT("♂♀",
MATCH(INDIRECT(ADDRESS(MATCH(INDEX(H4:H,MATCH(TRUE,INDEX((H4:H<>0),0),0)),H:H,0),7,4))-
VLOOKUP(T2,$B$2:$C$24,2,0),$S:$S,0)-4), "♂")), "♀", ""));
QUERY(INDIRECT(ADDRESS(MATCH(INDEX(H4:H,MATCH(TRUE,INDEX((H4:H<>0),0),0)),H:H,0),
COLUMN(H1),4)&":"&SUBSTITUTE(ADDRESS(1,COLUMN(H1),4),1,)))})
this solution can handle only positive offset
and unless the value in R4 is less than 6, it will work:
={ARRAYFORMULA(REGEXREPLACE(TRANSPOSE(SPLIT(REPT("♂♀", R4-4), "♂")), "♀", "")); H4:H}

Google Sheets ARRAYFORUMLA that can show 0 if the value is less than or equal to zero. Otherwise show the value of that set of data

I have set of columns that I am attempting to calculate the combined total of those columns then subtract from that total 8, if the difference after 8 is equal to or less than 0 I want to only show zero in the column I am doing this formula in. For those who might ask, I am using the ARRAYFORUMLA cause I want this calculation to repeat as I add new rows, keeping the totals I am seeking on the same row as the calculation is being done onto. So far I have most of this working. Well up to the IF ELSE THEN type of portion. My attempt is/was
=if(LTE((B3:B)+(C3:C)-8,0),ARRAYFORMULA((B3:B)+(C3:C)), 0)
As long as I'm understanding you correctly, I believe this will work:
=if(lte(sum(B2:C)-8,0),0,sum(B2:C))
It's at the top of the row and sums columns B and C. You can add more columns easily this way by either changing B/C to something else or passing more columns in.
Sum-8 is greater than 0
Sum-8 is less than 0
If what you want to do is to add each row to the total but only if its sum is 8 or greater, then your original formula was nearly OK but the two parts of the IF statement should have been reversed
=sum(ArrayFormula(if(LTE((B3:B)+(C3:C)-8,0),0,(B3:B)+(C3:C))))
You could also take most of the brackets out
=sum(ArrayFormula(if(LTE(B3:B+C3:C-8,0),0,B3:B+C3:C)))
and this would also work
=sum(ArrayFormula(if(LTE(B3:B+C3:C,8),0,B3:B+C3:C)))
Short answer
ARRAYFORMULA that can show 0 if the value is less than or equal to zero. Otherwise show the value of that set of data:
=ArrayFormula(IF(LTE(A1:A3,0),0,A1:A3))
Explanation
The basic IF syntax requires the use of scalar values, to use it with arrays, ARRAYFORMULA is required as an outer function:
ARRAYFORMULA(IF(array_logical_expression,array_if_true,array_if_false))
For the specific case described on the body of the question, the corresponding formula is:
=ARRAYFORMULA(IF(LTE(B3:B+C3:C-8,0),0,B3:B+C3:C))
Reference
Google Docs editors Help
IF
ARRAYFORMULA
Using arrays in Google Sheets

Resources