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)
Computed column, number sequence based on group
irukandji
I have:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
Column1
=======
A
A
B
B
C
D
D
D
</pre>
<br />
What i would like to have:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
Column1|Column2
===============
A |1
A |1
B |2
B |2
C |3
D |4
D |4
D |4
</pre>
<br />
Any help please, i am getting desperate...
Find more posts tagged with
Comments
kclark
Here's one way to do it. I used the following SQL statement.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
select contactlastname
from customers
order by contactlastname asc</pre>
<br />
Then I created a group in my table. Made the group header invisible. And counted each group on the header with this following code in onCreate()<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
pgv = reportContext.getPersistentGlobalVariable("groupCount");
count = parseInt(pgv) + 1;
newCount = count + "";
reportContext.setPersistentGlobalVariable("groupCount", newCount);</pre>
<br />
Then I was able to recall the PGV in in table.<br />
<br />