尋找一個公式來訪問從左到右移動的行級別隨時間的變化我想評估從第一個讀數到下一個讀數的百分比變化,然後根據第一個和前一個讀數評估所有後續讀數以訪問加班時間。如果存在大於或等於 20% 的向下偏移,則在結果列中指示為 1。
下面是一個公式,用於查找第一個偏移百分比,然後遍歷所有剩餘列並查找 和 值,並相對於初始值進行百分比變化,如果負變化 > 20%,則將結果設為1.
我很確定這不正是您正在尋找的東西。我不明白「然後根據第一個和前一個讀數評估所有後續讀數以獲取加班時間」到底意味著什麼。研究我的程式碼,看看它在做什麼,然後看看是否可以更改它以完全實現您真正想要的功能。如果沒有,請回覆一些有關我的 JSL 的說明或問題。
As Constant( dt = Current Data Table() );
theMatrix = dt[Row(), Index( 2, 23 )];
start = Loc( theMatrix )[1] + 1;
startVal = dt[Row(), start];
firstChange = .;
currentChange = .;
firstValue = .;
For( i = start, i <= 22, i++,
If(
Is Missing( dt[Row(), i] ) == 0 & Is Missing( firstValue ) == 1, firstValue = dt[Row(), i],
Is Missing( dt[Row(), i] ) == 0 & Is Missing( firstChange ) == 1,
firstChange = (dt[Row(), i] - firstValue) / firstValue,
Is Missing( dt[Row(), i] ) == 0 & Is Missing( firstChange ) == 0,
currentChange = (dt[Row(), i] - firstValue) / firstValue;
If( currentChange < -0.2,
currentChange = 1;
break(),
currentChange = .
);
)
);
currentChange;