Page 1 of 1

How can i take the MaxD() value from the SumD() values

Posted: Tue May 11, 2010 7:00 am
by M.I.A
Hello all

I want take the max number of the complete column for example the table below:

Student Present Number
5
12
20
16
3
25
11
18
20
8



I want take the max number of the above column, put it in variable or any other way to use it in the next column, for example the max number of the above column is (25), so my report should be like this:

Percentage Present ----------------------------------------------------------- Student Present Number
(5/25) * 100% --> Just the result must be here ----------------------------------------- 5
(12/25) * 100% ------------------------------------------------------------------------------- 12
(20/25) * 100% ------------------------------------------------------------------------------- 20
(16/25) * 100% ------------------------------------------------------------------------------- 16
(3/25) * 100% ------------------------------------------------------------------------------- 3
(25/25) * 100% ------------------------------------------------------------------------------- 25
(11/25) * 100% ------------------------------------------------------------------------------- 11
(18/25) * 100% ------------------------------------------------------------------------------- 18
(20/25) * 100% ------------------------------------------------------------------------------- 20
(8/25) * 100% -------------------------------------------------------------------------------- -8


I got the (Student Present Number) column by sitmulsoft, after I created datasource, I wrote under the text component in the text expression this: {SumD(DataSource1.StudentStatus)} and the result now coming correct for that column.




I tried this code in the code page in stimulsoft environment:
int maxNum = {MaxD{SumD(DataSource1.StudentStatus)}}


And under the text component of the (Percentage present) column I wrote this:
({SumD(DataSource1.StudentStatus)}/maxNum) * 100%

But ofcourese this did not work.

Please help, Thank you.


How can i take the MaxD() value from the SumD() values

Posted: Tue May 11, 2010 8:24 am
by Jan
Hello,

Can you attach your report this topic (or send it to support@stimulsoft.com). We need it to better understand report structure.

Thank you.

How can i take the MaxD() value from the SumD() values

Posted: Wed May 12, 2010 12:53 am
by M.I.A
Hello Jan

My report in the attachment.

Thank you.

How can i take the MaxD() value from the SumD() values

Posted: Wed May 12, 2010 5:39 am
by Jan
Hello,

If i right understand you need use following expression:

Code: Select all

{DataSource1.StudentStatus / MaxD(DataSource1.StudentStatus) * 100}%
Thank you.


How can i take the MaxD() value from the SumD() values

Posted: Wed May 12, 2010 8:24 am
by M.I.A
Hello Jan


Your code is close to what i want, but i exactly want something like this:

Code: Select all

{DataSource1.StudentStatus / MaxD(SumD(DataSource1.StudentStatus)) * 100}%
but i know this is not valid operation.

Because the Sum is not calculated in the (StudentStatus) column, and i calculate it in this line of code "SumD(DataSource1.StudentStatus)" and in the same time i want take the max value of this column after the sum operation.


Thank you.

How can i take the MaxD() value from the SumD() values

Posted: Thu May 13, 2010 2:07 am
by Jan
Hello,

In your report you have only one data source (and databand). So you receive only one result of calculation of SumD function. In this case MaxD function does not have sense.

Thank you.