Saltwater USA
Posts: 0
Joined: Thu Oct 23, 2014 2:18 am

I need help on Array and output please....

I am so sorry that I ask too many questions these days....

Your help will be greatly appreciated!!

Here are my mapping and data....

Image Image

I don't want all data from local storage... Here is logic that I want to express:

first set

var sign[1] = (predictions[1].v - predictions[0].v) / (predictions[1].t - predictions[0].t)
***sign = - or +

Then
If sign[1] is bigger or smaller than sign[2],
It will return to sign[1]
then if sign[1] is -1, return to Low
or sign[1] = 1, return to High

I can implement with excel but not java :(

Image

Please at least give me an idea how I can implement this please!!

Thank you....

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

I need help on Array and output please....

Hello!

Looks like you need the following code:

preif (sign[1] !== sign[2]){ // If sign[1] is bigger or smaller than sign[2]
return sign[1]; // It will return to sign[1]
} else if (sign[1] ){ // then if sign[1] is -1
return "Low"; // return to Low
} else if (sign[1] === -1){ // or sign[1] = 1
return "High"; // return to High
}/pre with your comments

Saltwater USA
Posts: 0
Joined: Thu Oct 23, 2014 2:18 am

I need help on Array and output please....

Hello Maryna!

Thank you for your response!

Where should I write this code? as JS in mapping? or as success event?
Also, I want to add another column Low/High value with the sign[1].

So the output I am looking for is,

2014-11-12 00:48 2.250 High

Finally,on grid, I want to populate only data with low or high values...

Thank you again!

Saltwater USA
Posts: 0
Joined: Thu Oct 23, 2014 2:18 am

I need help on Array and output please....

Thank you for your response!

I am having another problems, I will try everything I can before I start a new question.

Thanks!

Return to “Issues”