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 for Programming
 LabTalk Forum
 Column Formula: using sheet name issue
 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
1228 Posts

Posted - 07/19/2022 :  01:34:19 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 2023 (64-bit) Beta 2 10.0.0.58
Windows 7 Pro SP1 x64

Greetings!

I want to get a column with sums of rows (starting from column 2) in wks 1.

The following code works correctly:
sum(FirstSheetName$!,2,0)
string FirstSheetName = [%H]1!layer.displayname$;


However the following code:
sum([%H]1!layer.displayname$!,2,0)

or
sum(%([%H]1!layer.displayname$)!,2,0)

returns a column of "--".

What is the reason for this?
How do I use the LT phrase returning the 1st sheet name directly?

Thank you.

---
Andrey

YimingChen

1684 Posts

Posted - 07/19/2022 :  10:41:31 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I can reproduce the issue. It is working in script e.g. col(A) = sum(%([%H]1!layer.displayname$)!,2,0). But not working in SCV dialog. Is there reason you don't define the sheet name string in the Before Formula Scripts panel, and pass it to the formula?

James
Go to Top of Page

AKazak

Russia
1228 Posts

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

I can reproduce the issue. It is working in script e.g. col(A) = sum(%([%H]1!layer.displayname$)!,2,0). But not working in SCV dialog. Is there reason you don't define the sheet name string in the Before Formula Scripts panel, and pass it to the formula?

James



Dear James,

I tend to use BFS panel as less as possible and compose a complicated formula. Can you create a JIRA ticket for the issue, please?
In the meantime I will be using the script suggested by you above or my script from my original post.

---
Andrey
Go to Top of Page

YimingChen

1684 Posts

Posted - 07/19/2022 :  2:39:23 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Jira created: ORG-25530
Go to Top of Page

minimax

362 Posts

Posted - 07/25/2022 :  04:54:03 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi AKazak,

We will try to fix the problem you found.

But as to your case, you can just use following much simpler formula
sum(1!,2,0)


PS, layer.displayname$ is obsolete now. You can use layer.name$ directly.
Go to Top of Page

AKazak

Russia
1228 Posts

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

Hi AKazak,

We will try to fix the problem you found.

But as to your case, you can just use following much simpler formula
sum(1!,2,0)


PS, layer.displayname$ is obsolete now. You can use layer.name$ directly.



Got it!
Thanks.

---
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