community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

Creating a single string to represent a histrogram

Highlighted
Meteoroid

Hi,

 

Have had a good look through the archives, but not had any joy in working out how to solve the problem I am grappling with around trying to summarise a histrogram in a single string.

 

I have some leadtime information from production runs, and wish to present them (in another application) as a histogram.  In order to do this, I need to summarise the leaditme information, and capture some key statistics.  I have done this successfully, but am struggling to collate the information for a single product from across the rows of a final table.  I suspect a macro (or macros) is the answer....

 

Images below show - I hope - the data for the three products that I am looking to summarise.  The end table shows the key statistics for the three products, giving the number of 'bins' that the observations are placed in to, the size of the bins (the value range), and the average value of the observations in each of the bins (note, that not all bins have observations in them).

 

What I am looking to do is generate a single text stream that has:

The Product

Maximum Observation value

Minimum Observation value 

Total observations

Bin Range 1, start value, finish value

Bin Range 2, start value, finish value

...

Bin Range 1, % of observations

Bin Range 2, % of observations

...

 

and then express it something like:  "ProductNN_MaxLT=XX_MinLT=YY_TotalObs=ZZ_FirstBinRange_SecondBinRange_First.....

 

Welcome any thoughts and ideas


Many thanks

Jon

 

 Data.pngOutput.png

Nebula
Nebula

Hi @JonNic 

 

Can you post what the actual string for Product NN would be?  Your description "ProductNN_MaxLT=XX_MinLT=YY_TotalObs=ZZ_FirstBinRange_SecondBinRange_First...." is open to interpretation.  For example, what is the FirstBinRange and SecondBinRange.  

 

Dan

Meteoroid

Hi Dan,

 

The exact requirement for Product NN would be:

 

NN_Max15_Min01_No04_Bin1-1.00_Bin2-1.40_Bin3-1.80_Bin4-2.2_Bin5-2.6:Bin1-0.89_Bin2-0.00_Bin3-0.00_Bin4-0.00_Bin5-0.11

 

Which 'reads' as:

Product NN, Max value 15, Minimum value 1.  Four observations, Bin 1 has a lower value of 1.00, Bin 2 a lower value of 1.4..... and after the ":", Bin 1 has 89% of the observations, Bin 2 has 0% of observations....

 

Hope this helps


Many thanks

Jon

 

Nebula
Nebula

In your final table, you have 2 bins, 1 and 4.  In your string you have 5 bins. 

1. where does the extra bin come from?

2. How do you calculate the min values for the bins 2 and 3

3. Where does the Bin1-0.89 percentage come from.  your final data shows .75.

 

It almost looks like you copied the string from another sample.  Please post the string that would correspond to NN product for this example

 

Dan

  

Meteoroid

Apologies Dan,

 

I created the demo attached to try and make life simpler in my explanation, and ended up making it more confusing.

 

There should indeed be only four bins, and the string should read:

 

NN_Max15_Min01_No04_Bin1-1.00_Bin2-4.50_Bin3-8.00_Bin4-11.5:Bin1-0.75_Bin2-0.00_Bin3-0.00_Bin4-0.25

 

Which 'reads' as:

Product NN, Max value 15, Minimum value 1.  Four observations, Bin 1 has a lower value of 1.00, Bin 2 a lower value of 4.5..... and after the ":", Bin 1 has 75% of the observations, Bin 2 has 0% of observations....

 

I realise that there is an error in the calculation of the average per bin, which I will try and create, but hopefully this corrects the confusion of what I am trying to achieve.

 

To your final question - the min and max values are the min and max value observations for 'NN', across all bins


Thanks

Jon

Meteoroid

Updated workflow with correct calculation of average per bin, now

 

 

Nebula
Nebula

Hi @JonNic 

 

Here you go.  I tacked the string generating routine on to the end of your workflow

 

WF.png

 

Results 

 

Results.png

 

Dan

Meteoroid

Hi Dan

 

Thanks so much - really appreciate your support


Jon

Labels