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)
Sorting Stacked Chart on Value not used in Chart ,but in dataset
bcs0629
<p>Hey guys, I'm having an issue trying to sort on the x-axis for a chart based on a value that isn't being displayed on the chart. I'm using 3.7.2 and my dataset is returning the values in order of how I would expect to see them. For my chart I have a sort on my optional Y series grouping, which is necessary because I need the stacks to appear in a certain order. That sorting is fine. For my x-axis, I am plotting a column called <strong>Days </strong>(Monday, Tuesday, etc) and I am trying to get those sorted in order. In my dataset, I have another column called <strong>Day#</strong>, which gives each day a value which I would ideally sort on. The problem I am facing is that my x-axis sort is restricted to what my x series is, so I don't even have the ability to sort on the <strong>Day#. </strong> I tried using the <strong>Day#</strong> as the x series and replacing the strings, but since I'm taking a group average it gives me errors. I figure I'd be able to put in some kind of script but I'm not versed enough to know exactly which piece I'm going after. Any kind of direction would be greatly appreciated, I searched through a few other forum posts but nothing really stood out to me as a solution I can use.</p><p> </p><p>
Find more posts tagged with
Comments
kclark
<p>What DB are you using? You could do something like this in a sql query</p><pre class="_prettyXprint">select dayofweek ( practiceday ) as practiceDay, // other columnsfrom practiceTable</pre><p>This will return the days as 1-7. Then in the chart builder UI from select data you can select "edit group and sorting" on the x axis. Then set it to ascending.</p><p> </p><p>Later in your chart script you can check for the 1-7 values and replace them with the actual day names.</p>
bcs0629
<p>Thanks for the quick reply, I'm using MSSQL 2008. I've already a column that's giving me the the day number, but I'm not able to use that as my x axis because I need to display the full day. If you could point me to which script I could use to replace the number with the text then that would solve my needs. Also, I would think you'd be able to sort based on a data point in the dataset but not displayed on the chart but I guess not seeing as how the expression builder is grayed out for that.