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

How do I save histogram count data?

I have a data set with count vs time monitored during several days see attachment. In graph builder histograms for several days are shown for time intervals of 6 minutes. How can I save the daily histogram counts for each interval in a data table? 

1 ACCEPTED SOLUTION

Accepted Solutions
Victor_G
Super User

Re: How do I save histogram count data?

Hi Frank,

 

No problem, I unmarked my post as a solution.
I understand better your situation, and it shouldn't be too difficult to do it with binning : 

  1. Right-click in your column time, "New Formula Column", "Distributional", "Custom Binning".
  2. There, click on the red triangle next to "Cutpoints" and click on "Fill using Equal Width Bins..."
  3. Specify your offset and Width (every 6 mintues):

    Victor_G_0-1679515221420.png

  4. Click on OK ; a new column "Custom Binning [Time]" has appeared.
  5. Right click on this new column, "New Formula Column", and then "GroupBy". You can also do this on your "Label" column (day) if you want a count for every 6 minutes for each day. Without this second column as groupby variable, the sum will only be done for each timeframe, no matter the day.
  6. Then, right-click on the column "Count", "New Formula Column", "Aggregate" and then "Sum". This will create a sum column of "Count" for every 6 minutes and by Day if you have chosen the two Groupby variables (Sum[Count][Custom Binning[Time],Label]) and the JSL formula is 
Col Sum( :Count, :"Custom Binning[Time]"n, :Label )

If you have only selected the 6 minutes timeframe for your sum formula column, the JSL formula will be :

Col Sum( :Count, :"Custom Binning[Time]"n )

 

Victor_G_2-1679515881655.png

 

I hope I did understand better your question and that this answer will solve your question.
I attached the datatable with calculated column and graphs.

Victor GUILLER
Scientific Expertise Engineer
L'Oréal - Data & Analytics

View solution in original post

7 REPLIES 7
hogi
Level XI

Re: How do I save histogram count data?

you could use the Summary Platform to sum the counts for each time and day:

hogi_0-1679509690453.png
If you take time as it is, there is just a single entry per time step and day, therefore, it doesn't matter if you use mean, sum or median

By right clicking on time, you could change the aggregation -  to e.g. to calculate the counts vs. hours. Then Sum will make more sense.

hogi_1-1679509770372.png

 

 

Data Table( "HISTOGRAM DATA" ) << Summary(
	Group( :Time ),
	Sum( :Count ),
	Subgroup( :Label )
);
Victor_G
Super User

Re: How do I save histogram count data?

Hi @frankderuyck,

 

If I understand well your case (doing a sum of column count by day), here might be several options to do this, here are two :

  • Formula column : You can create a formula column of the sum of counts by day. To do it so, right-click on "Label", "New Formula Column", and then "GroupBy". Then, right-click on the column "Count", "New Formula Column", "Aggregate" and then "Sum". This will create a sum column of "Count" by "Day" (Sum[Count][Label]) and the JSL formula is 
    Col Sum(:Count, :Label)

Victor_G_0-1679509953597.png

  • Table Summary : You can also create a summary table, to aggregate the sum of count by day. To do so, go into "Tables", then "Summary", use your "Label" as group variable, your "Count" and statistics Sum as "Statistics" variable, and click OK. you'll have a small table aggregating the values of count by day :

Victor_G_1-1679510258864.png

JSL code to create this table is : 

// Data table summary

Data Table( "HISTOGRAM DATA" ) << Summary(
	Group( :Label ),
	Sum( :Count ),
	Freq( "None" ),
	Weight( "None" )
);

 

I hope I did understand well your goal and that this response will help you,

Victor GUILLER
Scientific Expertise Engineer
L'Oréal - Data & Analytics
frankderuyck
Level VI

Re: How do I save histogram count data?

Hi Victor, sorry I clicked accidentally on solution.. think there is a misunderstanding in my question; you gave me a solution for counts per day.

Let me clarify my question: for each day I want to tabulate the #counts in time intervals of 6 minutes; this is what the histograms in graph builder attached to the data table represent. 

jthi
Super User

Re: How do I save histogram count data?

Create binned column for Time (Cols/utilities/Make binning column) and use equal width bins of 6minutes

jthi_0-1679515675460.png

jthi_1-1679515680822.png

Then you can create Summary table based on that new column or use Col Sum formula and use that column as grouping with Label

Col Sum(:Count, :Label, :Time Binned)
-Jarmo
Victor_G
Super User

Re: How do I save histogram count data?

Hi Frank,

 

No problem, I unmarked my post as a solution.
I understand better your situation, and it shouldn't be too difficult to do it with binning : 

  1. Right-click in your column time, "New Formula Column", "Distributional", "Custom Binning".
  2. There, click on the red triangle next to "Cutpoints" and click on "Fill using Equal Width Bins..."
  3. Specify your offset and Width (every 6 mintues):

    Victor_G_0-1679515221420.png

  4. Click on OK ; a new column "Custom Binning [Time]" has appeared.
  5. Right click on this new column, "New Formula Column", and then "GroupBy". You can also do this on your "Label" column (day) if you want a count for every 6 minutes for each day. Without this second column as groupby variable, the sum will only be done for each timeframe, no matter the day.
  6. Then, right-click on the column "Count", "New Formula Column", "Aggregate" and then "Sum". This will create a sum column of "Count" for every 6 minutes and by Day if you have chosen the two Groupby variables (Sum[Count][Custom Binning[Time],Label]) and the JSL formula is 
Col Sum( :Count, :"Custom Binning[Time]"n, :Label )

If you have only selected the 6 minutes timeframe for your sum formula column, the JSL formula will be :

Col Sum( :Count, :"Custom Binning[Time]"n )

 

Victor_G_2-1679515881655.png

 

I hope I did understand better your question and that this answer will solve your question.
I attached the datatable with calculated column and graphs.

Victor GUILLER
Scientific Expertise Engineer
L'Oréal - Data & Analytics
frankderuyck
Level VI

Re: How do I save histogram count data?

Great, thanks  a lot Victor!

frankderuyck
Level VI

Re: How do I save histogram count data?

Now I can go to FDE and creat daily time spectra!