LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array Manipulation

Solved!
Go to solution

I really hope someone out there can help me with this.  I have an application I am trying to build for our production supervisors.  I have a set of data that contains a date/timestamp-type string (mmddhh), operator/workstation name, and pass or fail.  If I was doing this in excel I would simply pivot the data out, unfortunately, our production associates do not have the means for doing it in excel... which is why I'm creating this interface.  I would like the data formatted smilar to this:

oper-station P/F 060708 060709 060710 060711
Amy - 0218 Pass  500 505 475 500
  Fail 4 0 20 2
  Total 504 505 495 502
Bill - 0219 Pass  493 498 469 493
  Fail 4 0 20 2
  Total 497 498 488 495

 

or even like this:

  060708 060709 060710 060711
oper-station Pass Fail Pass Fail Pass Fail Pass Fail
Amy - 0218 500 4 505 0 475 20 500 2
Bill - 0219 493 4 498 0 469 20 493 2

I have very limited programming experience which LabVIEW has greatly helped with! but now it seems I'm stuck... please help!

 

I was able to get my data into this format... I just have not been able to get it pivoted....

Workstation EndTime Status
assoc20 - 0220 060116 Fail
assoc20 - 0220 060116 Pass
assoc20 - 0220 060116 Fail
assoc20 - 0220 060116 Fail
assoc20 - 0220 060116 Pass
assoc20 - 0220 060116 Pass
assoc18 - 0218 060116 Pass
assoc20 - 0220 060116 Pass
assoc18 - 0218 060116 Pass
assoc18 - 0218 060116 Pass
assoc20 - 0220 060116 Pass
assoc18 - 0218 060116 Pass
assoc18 - 0218 060116 Pass
assoc18 - 0218 060116 Pass
assoc20 - 0220 060116 Fail
assoc20 - 0220 060116 Pass
assoc18 - 0218 060116 Pass

 

 

0 Kudos
Message 1 of 9
(3,692 Views)

What do you mean by pivoted?  Pivoted around what?  Are you looking for the Transpose 2D array function?

0 Kudos
Message 2 of 9
(3,680 Views)

Psychologically, it is helpful for any LabVIEW expert, if you show that you made effort to create your VI. Can you post, what you have done so far, please? E.g. accumulating the data in a table, or so. Cheers,

0 Kudos
Message 3 of 9
(3,640 Views)

First, you have to count the cells programmatically. Then you can format any table you wish.

0 Kudos
Message 4 of 9
(3,637 Views)
Solution
Accepted by topic author dbrown78

Run and check the attachment for a (brute force) solution. Tell me, if you understand the solution. If you do, enjoy 🙂

Message 5 of 9
(3,618 Views)

Pivot tables in excel are used to count (or sum or average...etc) a particular data point.  So the table I have at the bottom of my post I would normally just put directly in excel and use pivot tables to count the number of  "pass" or "fail" results for each operator for each time stamp.  ....  For the data I have in the post (at the bottom) an excel pivot table turns it into this:

Count of count Column Labels  
Row Labels 060116 Grand Total
assoc18 - 0218 7 7
Pass 7 7
assoc20 - 0220 10 10
Fail 4 4
Pass 6 6
Grand Total 17 17
0 Kudos
Message 6 of 9
(3,604 Views)

Sorry (and Thanks!) ghighuphu....  Since I couldn't figure it out, I didn't see the value in posting what I'd done.  I was only able to get my code to the point where I accepted the transaction logs and manipulated the data into those three main data points....(associate/workstation, timestamp, pass/fail)... I really didn't think anyone would want to see it, lol - I am certainly no expert and it is a mess - but I'm learning!!!

I spent about 4 hours on trying to manipulate the data, with no success so I trashed that portion and posted here...  I will know better next time!  

 

Your vi makes complete sense...thank you so much!  you've truly saved me a lot of frustration! 

0 Kudos
Message 7 of 9
(3,589 Views)

Seems I posted too late.  I was working on this solution this morning.  Guess I need to come in earlier.  I believe it is a more complete solution where you give it the table like you posted and it will create the output you wanted as a 2D table.  It scans for all workstations, then for all parameters of each workstation.  So this handles when there are more columns then just EndTime.  This goes into an array of clusters which then is converted into the 2D table. It uses lots of OpenG array functions.

0 Kudos
Message 8 of 9
(3,577 Views)

I am glad I could help. Thank you for marking a solution and for KUDOs!

0 Kudos
Message 9 of 9
(3,573 Views)