Skip to main content
12-Amethyst
March 30, 2018
Solved

How to get a table of distinct rows with all columns

  • March 30, 2018
  • 1 reply
  • 6098 views

Hello , can anybody help me?

I am getting the repeated data of perticular characterisrtics but i want data distinctly but not only columns but also a row.If anyone knows the solution then please revert back. I tried using distict but it only give column not rows.

for example: I am having following table attached in image

 

now If we distict the table using ProcessID and PartID then table must be attached in image

 

The table must show the same values of the same row.

 

Thanks,

Pankaj Phopse

Best answer by Yedukrishnan

Please follow the steps

1. Query the stream(info1)

2. Create an infotable with the mentioned fields(info2)

3. Add first row of stream to that infotable;

4. Put a loop(i) where the loop length is stream length.

5. Put a second loop(j) inside the first loop for which the loop length is new infotable length.

6. Put a condition to check whether the stream part id and process id is same as that of the values in the infotable.

eg: if(info1.rows[i].Part == info2.rows[j].Part && info1.rows.Process == info2.rows[j].Process)

                break;

      else

                Add data to infotable

 Try it!!!

1 reply

5-Regular Member
March 30, 2018

Hello,

 

Can you provide some further detail of your expected result here? I'm not quite sure what you mean.

 

Thank you,

 

-- Craig A.

6-Contributor
March 31, 2018

Hello, 

   Lets take an example I have one stream which stores the data. In the stream columns are Part,Process,ActaulValue and Deviated Value. Now in the stream the data is of 100 rows in that the part ID and Process ID are diffrent like I have 5 Processes suppose A,B,C,D,E and Part are F,G,H,I,J.

Now in the table I am getting duplicated data  accordingly. Now I dont want the duplicated data of the same Process and Part, for example if Process A in the table is 5times and the data accordingly like:

 

row Process  PArt  Actual  Deviated

1.    A              F     10       15

2.    A              G    11       16

3.    A             G     12       17

4.    C              F     13       18

5.    B              F     10       19

 

Now in the above table A is repeated 3 times but I want this A must be unique according to part like:

1.  A  F 10 15

2. A  G 11 16

3. C  F  13 18

 

Like for the same Part and Process it should not repeat I want each row must be distinct.

 

 

Thank you.

14-Alexandrite
April 2, 2018

Please follow the steps

1. Query the stream(info1)

2. Create an infotable with the mentioned fields(info2)

3. Add first row of stream to that infotable;

4. Put a loop(i) where the loop length is stream length.

5. Put a second loop(j) inside the first loop for which the loop length is new infotable length.

6. Put a condition to check whether the stream part id and process id is same as that of the values in the infotable.

eg: if(info1.rows[i].Part == info2.rows[j].Part && info1.rows.Process == info2.rows[j].Process)

                break;

      else

                Add data to infotable

 Try it!!!