The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 2022b: crash on worksheet formula
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

AKazak

Russia
1205 Posts

Posted - 05/18/2022 :  08:18:03 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 2022b (64-bit) SR1 9.9.5.167
Windows 10 Pro x64

Greetings!

I have a column of labels with missing cells. I want to fill the cells with previous values by setting a column formula "=if(A==1/0,B[i-1],A)":


After hitting Enter sometimes I get Origin crash, but sometimes weird results.

Can you check this, please?

What is the correct way of filling such gaps in Origin?

Thank you.

---
Andrey

YimingChen

1640 Posts

Posted - 05/18/2022 :  09:52:19 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Can you try:
if(A[i]$ == "", B[i-1]$, A[i]$)

James
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 05/18/2022 :  10:51:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by YimingChen

Can you try:
if(A[i]$ == "", B[i-1]$, A[i]$)

James



It works as expected.
What is the difference between the original and suggested versions?

---
Andrey
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 05/18/2022 :  11:11:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
When you are dealing with text, you need to use string notation. Your original with 1/0 etc were numeric formula and result is unexpected when your column is text.

CP
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 05/18/2022 :  11:46:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by YimingChen

Can you try:
if(A[i]$ == "", B[i-1]$, A[i]$)

James



It works as expected.
What is the difference between the original and suggested versions?

---
Andrey
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 07/22/2022 :  08:35:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Here the another strange behavior with the following column formula:
IsEmpty(A[i])?B[i-1]:A[i]



Can you explain why Origin puts "--" in column B, please?

---
Andrey
Go to Top of Page

YimingChen

1640 Posts

Posted - 07/22/2022 :  09:00:08 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
There is a bug with IsEmpty() function. Can you use:

A[i] == 0/0 ? B[i - 1] : A[i]


James
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 07/22/2022 :  12:31:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by YimingChen

There is a bug with IsEmpty() function. Can you use:

A[i] == 0/0 ? B[i - 1] : A[i]


James



Dear James,

Got it.
Was the bug JIRAed?

---
Andrey
Go to Top of Page

YimingChen

1640 Posts

Posted - 07/22/2022 :  2:08:06 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Yes, the reference jira id is ORG-25538.
Go to Top of Page

minimax

354 Posts

Posted - 07/24/2022 :  10:53:21 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Here the another strange behavior with the following column formula:
isempty(A[i])?B[i-1]:A[i]




There is no problem.

Function IsEmpty() requires string type input, so you will have to type following to get the correct result.
IsEmpty(A[i]$)?B[i-1]:A[i]


i.e. add $ suffix after the cell notation, as CP mentioned previously.

https://www.originlab.com/doc/LabTalk/ref/IsEmpty-func
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 07/25/2022 :  1:08:14 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by minimax

quote:
Here the another strange behavior with the following column formula:
isempty(A[i])?B[i-1]:A[i]




There is no problem.

Function IsEmpty() requires string type input, so you will have to type following to get the correct result.
IsEmpty(A[i]$)?B[i-1]:A[i]


i.e. add $ suffix after the cell notation, as CP mentioned previously.

https://www.originlab.com/doc/LabTalk/ref/IsEmpty-func



Got it.
What is ORG-25538 then?

---
Andrey
Go to Top of Page

minimax

354 Posts

Posted - 07/25/2022 :  9:06:40 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
What is ORG-25538 then?


marked as "won't fix".
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 07/25/2022 :  10:47:28 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by minimax

quote:
Here the another strange behavior with the following column formula:
isempty(A[i])?B[i-1]:A[i]




There is no problem.

Function IsEmpty() requires string type input, so you will have to type following to get the correct result.
IsEmpty(A[i]$)?B[i-1]:A[i]


i.e. add $ suffix after the cell notation, as CP mentioned previously.

https://www.originlab.com/doc/LabTalk/ref/IsEmpty-func



This implies that I should know the type of column contents (text or numeric) in advance to use the correct formula syntax.
Is there a unified approach to check for empty, "--", non-a-number cell value?

---
Andrey
Go to Top of Page

minimax

354 Posts

Posted - 07/26/2022 :  04:26:42 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You may try combining other functions isna(), istext() like

(IsEmpty(A[i]$)||(isna(A[i])&&!istext(A[i]$)))?B[i-1]$:A[i]$
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 10/28/2022 :  02:10:46 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by minimax

You may try combining other functions isna(), istext() like

(IsEmpty(A[i]$)||(isna(A[i])&&!istext(A[i]$)))?B[i-1]$:A[i]$




In OriginPro 2022b (64-bit) SR1 9.9.5.167 I get the following odd behavior with the suggested formula:


However, if I apply the same formula to the source column, I get the expected and correct results:


Can you check this, please?

---
Andrey
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 10/28/2022 :  02:14:04 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Besides, more general form also does not work:
=(IsEmpty(wcol(j)[i]$)||(isna(wcol(j)[i])&&!istext(wcol(j)[i]$)))?wcol(j)[i-1]$:wcol(j)[i]$


---
Andrey
Go to Top of Page

minimax

354 Posts

Posted - 10/28/2022 :  03:29:18 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I wonder if you have a typo.

I suggest
B[i-1]$:A[i]$


But your screenshot writes
A[i-1]$:A[i]$
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 10/28/2022 :  04:34:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by minimax

I wonder if you have a typo.

I suggest
B[i-1]$:A[i]$


But your screenshot writes
A[i-1]$:A[i]$




It should not matter since you specify the column short name (A or B) explicitly, should it?

---
Andrey
Go to Top of Page

minimax

354 Posts

Posted - 10/28/2022 :  05:31:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Then I do not understand what problem you mean...

result of "...A[i-1]$:A[i]$" does match the values on your 1st screenshot, similar as below.

Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 10/28/2022 :  06:21:06 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by minimax

Then I do not understand what problem you mean...

result of "...A[i-1]$:A[i]$" does match the values on your 1st screenshot, similar as below.




The problem is that I expect the column formula to return the same results in columns A and B once pasted:


---
Andrey
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 10/28/2022 :  06:24:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I use OriginPro 2022b (64-bit) SR1 9.9.5.167 on Windows 10 Pro x64.

---
Andrey
Go to Top of Page

minimax

354 Posts

Posted - 10/31/2022 :  06:01:48 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
sorry that I still do not see anything wrong.

pasting following formula in col(B) first, and then col(A)

should compute exact result as your gif animation, as my screenshot explains.


(IsEmpty(A[i]$)||(isna(A[i])&&!istext(A[i]$)))?A[i-1]$:A[i]$
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 10/31/2022 :  12:14:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by minimax

sorry that I still do not see anything wrong.

pasting following formula in col(B) first, and then col(A)

should compute exact result as your gif animation, as my screenshot explains.


(IsEmpty(A[i]$)||(isna(A[i])&&!istext(A[i]$)))?A[i-1]$:A[i]$



What formula fill the gaps in the host column?

---
Andrey
Go to Top of Page

snowli

USA
1411 Posts

Posted - 10/31/2022 :  1:37:58 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Andrey,
I can reproudce what you saw in the gif. I put in P3 of ORG-25538 for developer to check.

Thanks, Snow
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 11/01/2022 :  01:02:26 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by snowli

Hi Andrey,
I can reproudce what you saw in the gif. I put in P3 of ORG-25538 for developer to check.

Thanks, Snow



Dear Snow,

I would be happy to test the update.

---
Andrey
Go to Top of Page

minimax

354 Posts

Posted - 11/01/2022 :  06:19:05 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
What formula fill the gaps in the host column?


As I have replied on 07/26/2022, you can use formula below to remove the blank cells.

(IsEmpty(A[i]$)||(isna(A[i])&&!istext(A[i]$)))?B[i-1]$:A[i]$


I still do not understand why you insist to use the bad one A[i-1]$

quote:
It should not matter since you specify the column short name (A or B) explicitly, should it?


They of course matter and will calculate different results.

What Snow reports is a false alarm.





Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 11/02/2022 :  01:51:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by minimax

quote:
What formula fill the gaps in the host column?


As I have replied on 07/26/2022, you can use formula below to remove the blank cells.

(IsEmpty(A[i]$)||(isna(A[i])&&!istext(A[i]$)))?B[i-1]$:A[i]$


I still do not understand why you insist to use the bad one A[i-1]$

quote:
It should not matter since you specify the column short name (A or B) explicitly, should it?


They of course matter and will calculate different results.

What Snow reports is a false alarm.




Got it now and confirm that the formula:
(IsEmpty(A[i]$)||(isna(A[i])&&!istext(A[i]$)))?B[i-1]$:A[i]$

delivers the expected results.


---
Andrey
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000