Home
Analytics
get total row count/ max
mh10
Hi,
i have table with columns
ROWNUM, col1, col2
in onCreate script i want to get count(ROWNUM) or max(ROWNUM)
how can i get max/ count of cloumn in script?
Thanks
Find more posts tagged with
Comments
mwilliams
Hi mh10,
Can you explain more about what you're trying to do, so I can offer the best suggestion?
mh10
Hi Michael,<br />
I am trying to change color of markers at start & end of line on chart.<br />
so what i thought to get these first and last values of these points by using ROWNUM column of dataset.<br />
so in onCreate event of table with this dataset i wanted to get values for fisrt row and last row so that in graph i can use these values in beforeDrawDataPointon() with onRender event.<br />
<br />
so that's why i want to know how to get Max(rownum).<br />
<br />
Is there any other way to change the color of start and end of markers.<br />
<br />
<br />
Thanks<br />
<br />
<blockquote class='ipsBlockquote' data-author="mwilliams"><p>Hi mh10,<br />
<br />
Can you explain more about what you're trying to do, so I can offer the best suggestion?</p></blockquote>
mwilliams
mh10,
You could probably add another computed column that shows the total count of the dataset. Then, grab that number from the dataset for the last one.
mh10
Hi Michael,<br />
as you said i created computed column for total row count<br />
and in onCreate<br />
<br />
temp = this.getRowData().getColumnValue("ROW_NUM");<br />
tempp = this.getRowData().getColumnValue("MAX_ROW_COUNT");<br />
if (temp==tempp)<br />
{ <br />
var tempCLm = this.getRowData().getColumnValue("COL_ONE");<br />
<br />
}<br />
<br />
<br />
but when i execute with this it throws Java Null pointer exception,<br />
while when i put real number instead of 'tempp' like <br />
if (temp==7)<br />
<br />
then it works fine...<br />
why it is throwing exception with 'if (temp==tempp)'<br />
<br />
<br />
Also, i have two marker points on horizantal line, when i use beforeDrawDataPoint()...both marker get same color...as they have same value...but i want to show different color for each marker.<br />
How can i differenciate two markers with same orthogonal value, so that i can give each marker different color?<br />
<br />
<br />
Thanks<br />
<br />
<br />
<br />
<br />
<br />
<br />
<blockquote class='ipsBlockquote' data-author="mwilliams"><p>mh10,<br />
<br />
You could probably add another computed column that shows the total count of the dataset. Then, grab that number from the dataset for the last one.</p></blockquote>
mwilliams
mh10,
When you set the max count variable, you may need to wrap it in a check for the value being null.
As for the setting a marker a different color that is the same orthogonal value, you can set the color based on the x-axis value as well.
mh10
charts x-axis has values like<br />
<br />
'4th month + last 2 months'<br />
'5th month + last 2 months'<br />
<br />
when i used these values with onCreate(), before DrawDataPoint().<br />
<br />
it returns ERROR:<br />
<br />
Java.lang.NumberFormatException: For input string '4th month + last 2 months'<br />
<br />
<br />
Any suggestions<br />
<br />
<br />
Thanks<br />
<br />
<blockquote class='ipsBlockquote' data-author="mwilliams"><p>mh10,<br />
<br />
When you set the max count variable, you may need to wrap it in a check for the value being null.<br />
<br />
As for the setting a marker a different color that is the same orthogonal value, you can set the color based on the x-axis value as well.</p></blockquote>
mwilliams
mh10,
Can you set up a .csv database with a sample of your data and a report that uses this flat file database set up just like you want. Then, explain to me what you're wanting to do and I'll try to change that example to work like you want it. This way I can test the report with your data to make sure I can get it to work. Thanks.
mh10
Hi Michael,<br />
see attached Linechart.zip file.<br />
i am looking to draw graph as shown on that file.<br />
<br />
it has three horizantal line, and i have color markers in like 'T' shape with different color.<br />
<br />
Also in Legend i have to show only 4 symbols for each of these colored markers.....hide the initial symbols for the three lines.<br />
<br />
<br />
<br />
Thanks<br />
<br />
<br />
<br />
<br />
<br />
<blockquote class='ipsBlockquote' data-author="mwilliams"><p>mh10,<br />
<br />
Can you set up a .csv database with a sample of your data and a report that uses this flat file database set up just like you want. Then, explain to me what you're wanting to do and I'll try to change that example to work like you want it. This way I can test the report with your data to make sure I can get it to work. Thanks.</p></blockquote>
mwilliams
mh10,
Can you attach a flat file of sample data for me to work with in .csv format please? Thanks.
mh10
following fuction helped me in changing any markers color.
it uses x-axis values and series title....to point out marker..
function beforeDrawDataPoint(dph, fill, icsc)
{
// Check if this is the line series (which contains the image marker)
// the series name is hardcoded
if (dph.getSeriesDisplayValue().equals("Series 1"))
{
// get the category value
value = dph.getBaseValue();
// based on category, change the icon url for the marker.
if ( value.equals("4th month 07"))
fill.set(0,255,0);
else if ( value.equals("3rd month 06"))
fill.set(255,255,30);
else
null;
}
}
great!!!!!!!!!!!!!!!
mwilliams
mh10,
Exactly what I was going to set up if I had been able to test it.
Glad you figured it out!