Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
calculate median on a column based on the time range
ajunuthula
<p>Hi,</p><p> </p><p>I have a csv file with two columns.</p><p> </p><p>First column is a date and second column is number.</p><p>I have a requirement where I need to calculate the median of the second column when the date in the first column is between 05-31-2009 and 04-30-2010.</p><p> </p><p>Can you suggest me as how to proceed with this, any ideas?</p><p> </p><p>Thank you.</p>
Find more posts tagged with
Comments
kclark
<p>You could create a computed column in your dataset that does this for you. You'll need to make sure the aggregation is set to MEDIAN, then you could use an expression like this</p><pre class="_prettyXprint">if(row["col1"] > "05-31-2009" && row["col1"] < "04-30-2010") { row["col2"]}</pre><p>This will compute the median for all values between those dates.</p>