通过方程和查找计算复杂字段 [英] Calculating Complex Fields via equations and lookups

查看:73
本文介绍了通过方程和查找计算复杂字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我正在尝试计算两个字段''AcrossGrain''和''WithGrain''两个都有分配给它们的方程式例如:


方程:Depth-BBackVoid -CarcT或Height-CarcT * 2

我有一个参数表(parmas),它具有分配给它们的所有值,例如:


BBackVoid = 22

CarcT = 18

默认深度= 300


计算结果为300-22-18 = 260 (AcrossGrain)


但是当通过OrderLine字段输入方程的答案时,我需要通过表(stkbommas)查找方程并使用parmas值计算方程。说实话,我不知道如何解决这个问题。这是有人给我的,但我似乎无法让它工作,而且我不完全确定它在做什么。我已经尝试将函数调用到字段但是我很确定编码并不是因为没有查找代码。

Hi i am trying to calculate two fields ''AcrossGrain'' and ''WithGrain'' both of which have equations assigned to them for example:

Equations: Depth-BBackVoid-CarcT or Height-CarcT*2

I do have a parameter table (parmas) which has all the values assigned to them for example:

BBackVoid = 22
CarcT = 18
Default Depth = 300

Calculation would be 300-22-18 = 260 (AcrossGrain)

However when inputting the answer to the equation via the OrderLine fields, i need to lookup the equation via the table (stkbommas) and calculate the equation using the parmas values. To be honest i dont have a clue how to work this out. This is what someone has given me however i can''t seem to get it to work plus i am not entirely sure what it is doing. I have tried calling the function to the fields however i am pretty sure the coding isn''t all there as there is no lookup code.

<跨度类= codeLink 的onclick = 模糊(此,this.parentNode.parentNode,的getChildren(本),TRUE);>展开 <跨度类= codeDivider > | 选择 | Wrap | 行号

推荐答案

根据您之前指出的表和字段名称,以及您只有2个方程式处理的事实,我修改了代码以便您可以简单地传递等式的名称来执行:
Given your Table and Field Names as you previously indicated, and the fact that you only have 2 Equations to deal with, I''ve revised the code so that you can simply pass the Name of the Equation to execute:
展开 | 选择 | Wrap | 行号


唯一的问题是我有37个参数值并且方程式根据股票详细信息而不同。我有50个不同的方程式。您建议我在这做什么?
The only problem with this is that i have 37 parameter values and the equations are different based upon the Stock Details. I have something like 50 different equations. What would you suggest i do here?


以下是参数值:


ParameterID ParameterShortDesc ParameterLongDesc值

1宽度宽度300

2深度深度300

3高度570

4 BBackVoid Base Back Void 22

5 WBackVoid Wall Back Void 22

6 TBackVoid Tall BackVoid 22

7 WShelfSetBack Wall Shelf Back Back 10

8 BShelfSetBack Base Shelf Set Back 10

9 TShelfSetBack高架后背10

10凹槽槽深度9

11 CarcT胎体厚度18

12抽屉抽屉侧面厚度140

13 RailT导轨厚度140

14 BackT背部厚度140

15 PlinthH Plinth高度150

16 FrameSW框架样式宽度36

17 FrameTH框架顶部高度36

18 FrameBH框架底部高度36

19 FrameRH框架导轨高度36

20 DoorSW门型宽度72

21 DoorTH门顶高度72

22 DoorBH门底高度72

23抽屉抽屉侧面高度72

24抽屉抽屉前端高度140

25抽屉抽屉背部高度140

26抽屉面板抽屉面板高度150

27抽屉深度抽屉抽屉深筋膜高度320

28 Tenon Tenon 9

29 Play Play 2

30调整调整1

36 MullionWid竖框宽度90

37 MidRailWid中轨宽度140


这里有一些公式:


SSBOMID StkID SubStkID数量WithGrain AcrossGrain Edged MaterialID

1 135 148 1宽度 - CarcT * 2 Depth-Bbackvoid-CarcT两者1

2 135 170 1高度深度均为1

3 135 171 1高度深度均为1

4 135 149 1宽度 - CarcT * 2 Depth-Bbackvoid-CarcT-BshelfSetBack均为1

5 135 133 1高度 - 车宽 - 车辆均为1

6 137 148 1宽度 - CarcT * 2深度 - Bbackvoid-CarcT均为1

7 137 170 1高度深度均为1

8 137 171 1高度深度均为1

9 137 185 1宽度 - CarcT * 2 RailT均为1

10 137 149 1宽度 - CarcT * 2 Depth-Bbackvoid-CarcT-BShelfSetBack两者1

11 137 185 1宽度 - Carct * 2 RailT两者1

12 137 173 1深度 - Bbackvoid-Carct MidRailWid两者1

13 137 173 1深度 - Bbackvoid-carct MidrailWid两者1

14 139 170 1高度深度两者1

15 139 171 1高度深度均为1

16 139 148 1宽度 - CarcT * 2深度 - Bbackvoid-CarcT均为1

17 139 185 1宽度 - CarcT * 2 RailT两者1

18 139 149 1宽度 - CarcT * 2 Depth-BBackVoid-CarcT两者1

19 136 170 1高度深度两者1

20 136 171 1高度深度均为1

21 136 148 1宽度 - CarcT * 2深度 - Bbackvoid-CarcT均为1

22 136 149 1 Width-CarcT * 2 Depth-Bbackvoid-CarcT-BShelfSetBack Both 1

23 136 185 1 Width-CarcT * 2 RailT Both 1

24 136 133 1宽度CarcT * 2高度-C arcT Both 1

25 136 174 1 Height-CarcT * 2 MullionWid Both 1

26 138 170 1 Height Depth Both 1

27 138 171 1高​​度深度均为1

28 138 148 1宽度 - CarcT-BBackVoid宽度 - CarcT-BBackVoid两者1

29 138 150 1宽度 - CarcT-BBackVoid宽度 - CarcT- BBackVoid两者1

30 138 149 1 Width-CarcT-BBackVoid-BShelfSetBack Width-CarcT-BBackVoid-BShelfSetBack两者1

31 138 133 1宽度 - CarcT-BBackVoid宽度 - CarcT-BBackVoid-CarcT两者1

32 138 133 1宽度 - CarcT-BBackVoid宽度 - CarcT-BBackVoid-CarcT两者1


你觉得我怎么样?需要做什么?
Here are the parameter values:

ParameterID ParameterShortDesc ParameterLongDesc Value
1 Width Width 300
2 Depth Depth 300
3 Height Height 570
4 BBackVoid Base Back Void 22
5 WBackVoid Wall Back Void 22
6 TBackVoid Tall BackVoid 22
7 WShelfSetBack Wall Shelf Set Back 10
8 BShelfSetBack Base Shelf Set Back 10
9 TShelfSetBack Tall Shelf Set Back 10
10 Groove Groove Depth 9
11 CarcT Carcass Thickness 18
12 DrawerST Drawer Side Thickness 140
13 RailT Rail Thickness 140
14 BackT Back Thickness 140
15 PlinthH Plinth Height 150
16 FrameSW Frame Style Width 36
17 FrameTH Frame Top Height 36
18 FrameBH Frame Bottom Height 36
19 FrameRH Frame Rail Height 36
20 DoorSW Door Style Width 72
21 DoorTH Door Top Height 72
22 DoorBH Door Bottom Height 72
23 DrawerSH Drawer Side Height 72
24 DrawerFH Drawer Front Height 140
25 DrawerBH Drawer Back Heigth 140
26 DrawerFasciaH Drawer Fascia Height 150
27 DrawerDeepFasciaH Drawer Deep Fascia Height 320
28 Tenon Tenon 9
29 Play Play 2
30 Adjustment Adjustment 1
36 MullionWid Mullion Width 90
37 MidRailWid Mid Rail Width 140

And here are some of the equations:

SSBOMID StkID SubStkID Qty WithGrain AcrossGrain Edged MaterialID
1 135 148 1 Width-CarcT*2 Depth-Bbackvoid-CarcT Both 1
2 135 170 1 Height Depth Both 1
3 135 171 1 Height Depth Both 1
4 135 149 1 Width-CarcT*2 Depth-Bbackvoid-CarcT-BshelfSetBack Both 1
5 135 133 1 Height-CarcT Width-CarcT Both 1
6 137 148 1 Width-CarcT*2 Depth-Bbackvoid-CarcT Both 1
7 137 170 1 Height Depth Both 1
8 137 171 1 Height Depth Both 1
9 137 185 1 Width-CarcT*2 RailT Both 1
10 137 149 1 Width-CarcT*2 Depth-Bbackvoid-CarcT-BShelfSetBack Both 1
11 137 185 1 Width-Carct*2 RailT Both 1
12 137 173 1 Depth-Bbackvoid-Carct MidRailWid Both 1
13 137 173 1 Depth-Bbackvoid-carct MidrailWid Both 1
14 139 170 1 Height Depth Both 1
15 139 171 1 Height Depth Both 1
16 139 148 1 Width-CarcT*2 Depth-Bbackvoid-CarcT Both 1
17 139 185 1 Width-CarcT*2 RailT Both 1
18 139 149 1 Width-CarcT*2 Depth-BBackVoid-CarcT Both 1
19 136 170 1 Height Depth Both 1
20 136 171 1 Height Depth Both 1
21 136 148 1 Width-CarcT*2 Depth-Bbackvoid-CarcT Both 1
22 136 149 1 Width-CarcT*2 Depth-Bbackvoid-CarcT-BShelfSetBack Both 1
23 136 185 1 Width-CarcT*2 RailT Both 1
24 136 133 1 Width-CarcT*2 Height-CarcT Both 1
25 136 174 1 Height-CarcT*2 MullionWid Both 1
26 138 170 1 Height Depth Both 1
27 138 171 1 Height Depth Both 1
28 138 148 1 Width-CarcT-BBackVoid Width-CarcT-BBackVoid Both 1
29 138 150 1 Width-CarcT-BBackVoid Width-CarcT-BBackVoid Both 1
30 138 149 1 Width-CarcT-BBackVoid-BShelfSetBack Width-CarcT-BBackVoid-BShelfSetBack Both 1
31 138 133 1 Width-CarcT-BBackVoid Width-CarcT-BBackVoid-CarcT Both 1
32 138 133 1 Width-CarcT-BBackVoid Width-CarcT-BBackVoid-CarcT Both 1

What do you think i need to do?


这篇关于通过方程和查找计算复杂字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆