cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
GregMcMahon
Level III

Workflow builder and referencing

Hi everyone,

I'm trying to build a workflow that will allow be to quickly look at numerous csv files that all have the same format, number of variables, column names etc. I didn't think it would be that complicated but I'm having trouble with the referencing. I've attached an example file (a deconstructed quantitative mass image with x, y pixel locations and mass counts at each pixel). I first bin x and y into equal bin widths of two (binning the image). I then go to tabulate and put bin x up top, bin y along the side, choose my statistic as sum, and then dump all the 7 mass count variables in (16O, 31P, 77Se etc.). I then order the columns alphabetically so I can create a stacked table for each mass and keep the bin y column. This gives me a label column and bin y , which are the x,y coordinates, and a count that is now the sum from the counts in each of the 2x2 binned pixels. But when I try this, I always get hiccups with tables not being available, and it is not clear to me why some of the "untitled" tables appear in the reference manager and some do not. Ultimately, I'd like the workflow to work in such a way that all I need to do is select the different .csv files.   Thanks for any suggestions! Best regards, Greg

4 REPLIES 4
hogi
Level XI

Re: Workflow builder and referencing

You could use Tables/Summary with a self-made grouping column:

Names Default to here();

PickFile();
dt = Current Data Table() ;
dt << New Column( "bins",
	Numeric,
	"Continuous",
	Format( "Best", 12 ),
	Formula( Floor( :x / 2 ) + Floor( :y / 2 ) * 1000 ),
	Set Selected
);

dt << Summary(
	Group( :myBins ),
	Min( :x ),
	Min( :y ),
	Sum( :"Sum : [16O]"n ),
	Sum( :"Sum : [12C14N]"n ),
	Sum( :"Sum : [12C15N]"n ),
	Sum( :"Sum : [31P]"n ),
	Sum( :"Sum : [77Se]"n ),
	Sum( :"Sum : [80Se]"n ),
	Sum( :"Sum : [82Se]"n ),
	Sum( :"Sum : [-]"n )
)

 

hogi
Level XI

Re: Workflow builder and referencing

Or shorter - with a transform column which you can define in the Summary menu:

hogi_0-1690569359059.png

 

 

Names Default to here();

PickFile();
 Current Data Table()  << Summary(
	Group( Transform column("myBins", Formula(Floor( :x / 2 ) + Floor( :y / 2 ) * 1000)) ),
	Min( :x ),
	Min( :y ),
	Sum( :"Sum : [16O]"n ),
	Sum( :"Sum : [12C14N]"n ),
	Sum( :"Sum : [12C15N]"n ),
	Sum( :"Sum : [31P]"n ),
	Sum( :"Sum : [77Se]"n ),
	Sum( :"Sum : [80Se]"n ),
	Sum( :"Sum : [82Se]"n ),
	Sum( :"Sum : [-]"n )
)
GregMcMahon
Level III

Re: Workflow builder and referencing

Thanks Hogi - This is a much more elegant solution than mine for sure!

Best,

Greg

WebDesignesCrow
Super User

Re: Workflow builder and referencing