LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Filtering string data table based on certain date range

Solved!
Go to solution

Hi all,

 

I need your help and advice. It's been long that I have used LV and currently doing some project for services planning.

 

I want to filter out a string table full of expected date for servicing with all the equipment data/descriptions based on month and year.

 

What is the best solution to do it? Do I need to extract each column from the 2D array and find all the index? Can you guys help me out?

Download All
0 Kudos
Message 1 of 8
(3,132 Views)

Hi azh,

 

with the InRangeAndCoerce function you should not attach timestamp arrays to the upper/lower limit inputs: a scalar timestamp is sufficient!

And most probably you want to use the boolean "InRange?" output rather than the "coerced value" output:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 8
(3,105 Views)

Hi GerdW,

 

Thanks for your response and tips Smiley Wink. I already tried out finding all the indices that matches the "in range" section as attached. So I guess I have to extract all section in 2D array into 1D array (Next PM Date1, Date2...), filter it to the same range and build back the 2D array correct? 

 

Regards.

Azh

Download All
0 Kudos
Message 3 of 8
(3,053 Views)
Solution
Accepted by topic author azhwoony

What version of LV?

in range.png

I'm assuming the arrays are the same length.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 4 of 8
(3,017 Views)

Hi Bill,

 

Thanks for the tips! It was helpful to simplify on getting the date and service in range.

Am using LV 2018 SP1

 

regards,

Azh

0 Kudos
Message 5 of 8
(2,974 Views)

Guys,

 

There's been 1 issue when I tried to add up the date to the PM period. The problem is when I pull data from a text file and convert it to number, the date can no longer add up to the calculated period. However, when I simulate using new DBL control, it works. Can u advise? Attached as reference.

Download All
0 Kudos
Message 6 of 8
(2,965 Views)
Solution
Accepted by topic author azhwoony

Hi azh,

 

The problem is when I pull data from a text file and convert it to number, the date can no longer add up to the calculated period. However, when I simulate using new DBL control, it works.

The problem is the different display format of "PM freq (in days)" and "x*y (days)"!

"Date PM Array" is calculated correctly because you add days.

"Date PM Array 2" is wrong because you add seconds…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 8
(2,959 Views)

Thanks gerd. It solves all Smiley Very Happy x*y is just converting period in month to number of days. So i just times seconds to it.

0 Kudos
Message 8 of 8
(2,950 Views)