Select Where as a groupHello,
I am struggling with selecting several group of rows with categorize by data in row :Folder.
My objective is to clean up the data table with full group of "0" or empty cells
For example, i have a data table as such;
| Well | Data | Folder |
| A1 | 0 | 20200107 011 3F |
| A2 | 0 | 20200107 011 3F |
| A3 | 0 | 20200107 011 3F |
| A4 | 0 | 20200107 011 3F |
| A5 | 0 | 20200107 011 3F |
| A6 | 0 | 20200107 011 3F |
| A7 | 0 | 20200107 011 3F |
| A8 | 0 | 20200107 011 3F |
| A9 | 0 | 20200107 011 3F |
| A10 | 0 | 20200107 011 3F |
| A11 | 0 | 20200107 011 3F |
| A12 | 0 | 20200107 011 3F |
| A1 | 7544.868393 | 20210104 002 1F |
| A2 | 7428.832161 | 20210104 002 1F |
| A3 | 0 | 20210104 002 1F |
| A4 | 8172.858217 | 20210104 002 1F |
| A5 | 7498.462766 | 20210104 002 1F |
| A6 | 8097.892056 | 20210104 002 1F |
| A7 | 8293.360203 | 20210104 002 1F |
| A8 | 7553.37215 | 20210104 002 1F |
| A9 | 7247.308905 | 20210104 002 1F |
| A10 | 7720.272697 | 20210104 002 1F |
| A11 | 7583.015099 | 20210104 002 1F |
| A12 | 8204.126781 | 20210104 002 1F |
| A1 | 9338.33795 | 20210104 007 1F |
| A2 | 9128.858265 | 20210104 007 1F |
| A3 | 9451.369309 | 20210104 007 1F |
| A4 | 9630.497262 | 20210104 007 1F |
| A5 | 10168.6979 | 20210104 007 1F |
| A6 | 10661.44516 | 20210104 007 1F |
| A7 | 9974.956184 | 20210104 007 1F |
| A8 | 9563.327404 | 20210104 007 1F |
| A9 | 9382.459181 | 20210104 007 1F |
| A10 | 9495.7588 | 20210104 007 1F |
| A11 | 9501.20388 | 20210104 007 1F |
| A12 | 10190.34965 | 20210104 007 1F |
| A1 | 9892.506179 | 20210104 008 1F |
| A2 | 8803.620355 | 20210104 008 1F |
| A3 | 9106.947088 | 20210104 008 1F |
| A4 | 9620.514722 | 20210104 008 1F |
| A5 | 10422.77538 | 20210104 008 1F |
| A6 | 9931.952661 | 20210104 008 1F |
| A7 | 10465.03549 | 20210104 008 1F |
| A8 | 10313.01828 | 20210104 008 1F |
| A9 | 9515.805162 | 20210104 008 1F |
| A10 | | 20210104 008 1F |
| A11 | 9638.32667 | 20210104 008 1F |
| A12 | 9230.893171 | 20210104 008 1F |
How do select and delete off a group of data rows by :Folder, while maintaining the "0" or empty cells that have some values for other :Well in the :Folder
After the clean up, the data table should look like this:
| Well | Data | Folder | |
| A1 | 7544.868 | 20210104 002 1F |
| A2 | 7428.832 | 20210104 002 1F |
| A3 | 0 | 20210104 002 1F |
| A4 | 8172.858 | 20210104 002 1F |
| A5 | 7498.463 | 20210104 002 1F |
| A6 | 8097.892 | 20210104 002 1F |
| A7 | 8293.36 | 20210104 002 1F |
| A8 | 7553.372 | 20210104 002 1F |
| A9 | 7247.309 | 20210104 002 1F |
| A10 | 7720.273 | 20210104 002 1F |
| A11 | 7583.015 | 20210104 002 1F |
| A12 | 8204.127 | 20210104 002 1F |
| A1 | 9338.338 | 20210104 007 1F |
| A2 | 9128.858 | 20210104 007 1F |
| A3 | 9451.369 | 20210104 007 1F |
| A4 | 9630.497 | 20210104 007 1F |
| A5 | 10168.7 | 20210104 007 1F |
| A6 | 10661.45 | 20210104 007 1F |
| A7 | 9974.956 | 20210104 007 1F |
| A8 | 9563.327 | 20210104 007 1F |
| A9 | 9382.459 | 20210104 007 1F |
| A10 | 9495.759 | 20210104 007 1F |
| A11 | 9501.204 | 20210104 007 1F |
| A12 | 10190.35 | 20210104 007 1F |
| A1 | 9892.506 | 20210104 008 1F |
| A2 | 8803.62 | 20210104 008 1F |
| A3 | 9106.947 | 20210104 008 1F |
| A4 | 9620.515 | 20210104 008 1F |
| A5 | 10422.78 | 20210104 008 1F |
| A6 | 9931.953 | 20210104 008 1F |
| A7 | 10465.04 | 20210104 008 1F |
| A8 | 10313.02 | 20210104 008 1F |
| A9 | 9515.805 | 20210104 008 1F |
| A10 | | 20210104 008 1F |
| A11 | 9638.327 | 20210104 008 1F |
| A12 | 9230.893 | 20210104 008 1F |
Regards
Ashraff
Data Blending and CleanupRe: Select Where as a groupThanks Jim,
I knew that there is a more elegant way of structuring the code as you demonstrated.
Thank You!
Regards
Ashraff
Re: Select Where as a groupYour code can be simplified. There isn't a need to create the new formula column.
names default to here(1);
cctable = current data table();
cctable << select where(col mean(:data,:folder)==0);
cctable << delete rows;
Re: Select Where as a groupHello,
I think i manage to solve this.. in not very smart way, but it works.
I create an average data column and select the rows that he average == 0
then delete off the rows.
cctable << New Column( "DataAverage",Numeric,Continous,Format( "Best", 9 ),
Formula( Col Mean(:Data, :Folder)));
cctable << Row Selection(Select where( :DataAverage == 0));
cctable << delete rows();
cctable << delete column(column("DataAverage"));
This serve the purpose,
but if anybody have a more robust way of scripting this, do let me know.
Regards
Ashraff