I am new to Knime. Can anyone help me with this ?
I have the data shown for every min but I need to calculate the number of calls for every hour?
how to get the call count for every hour?
say for example, I have a data like
I need to get like
6am-7am — 4
7am-8am — 5
8am-9am ---- 5
Please if someone can help me. Thank You
If it is not first format your data as time (String to DateTime node) then extract only the hours (Rxtract DateTime Fields node). At the end use GroupBy node
I like the solution posed by @andrejz, you can also use regex to extract the first digit from each of your times and then use groupby using a summation aggregation.
Regex is more complex, but can be handy for other situations.
Extract_Hour_Then_Groupby.knar.knwf (8.6 KB)
Also I am able to do the above solution mentioned by @andrez.
But do I need to use the loop to get the counts for the hours 6AM to 8PM or is there any better logic to work with.
@sophia_09 You can use cell splitter node and there split by “:” so you get the hour. Then use the GroupBy node (as already mentioned before).
I got the solution . I just used Extract date Time Field and Group by node to get the count by hours.
Thank you all.
If you want to group data (hours) in a range (for example 0-3, 4-7,…) you can use Auto Binner or Numeric Binner node to create this ranges.
This can also be done with the Rule engine node (in this case you can divide the day in night, morning afternoon,…)
Thanks a lot @andrejz
Another Query: I used Math Formula Node to calculate Percentage. But to add % symbol to the numbers in that column?
I Used Java Snippet node to display the percentage. but it got displayed before the number like %15. But Need to display 15%
I uses Numeric Binner Node to group the data. it got worked. Thanks a lot
You can also use String manipulation node … somethig like join(string(yournumbercolumn),"%")
Its working. Thanks a lot @andrejz
Is it possible to display Data labels in the bar chart in knime?
I use python nodes with plotly express to make different kind of charts.
Can you use python?
: Thanks a lot for your great help.
As I am new to Knime I am struggling lot to find the nodes.
PFA screenshot of my model. Your timely help is appreciable.
I don’t have permission to install python in the remote desktop. but i will try the python option in my personal machine.
Here you can find some examples and the code for bar charts using plotly express
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.