1. Raymond Longoria
  2. PowerBuilder
  3. Friday, 2 June 2023 00:27 AM UTC

I have a datawindow with one group. The database column that the group is based on can have either letters or a blank. I need to get the group total of the rows that have a blank and make that total available to add to the other group totals that have letters. I am cannot figure out how to do this. I hope my explanation is clear.

Accepted Answer
Raymond Longoria Accepted Answer Pending Moderation
  1. Wednesday, 7 June 2023 21:58 PM UTC
  2. PowerBuilder
  3. # Permalink

I ended up redoing the datawindow with 2 groups and I was able to get the result I needed. Thank you to everyone who contributed to this thread.

Comment
There are no comments made yet.
Sivaprakash BKR Accepted Answer Pending Moderation
  1. Friday, 2 June 2023 12:17 PM UTC
  2. PowerBuilder
  3. # 1

Raymond,

Do you mean CumulativeSum, anyway?   
How you want to display the sum?     Say, all values under empty group value will appear first, IMO.   Next group, with letters, will appear and group total for that group will get displayed.  Do you want this group total to include the sum of blank group total also?  

If yes, then you can try CumulativeSum function.

Happiness Always
BKR Sivaprakash

 

 

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 2 June 2023 04:34 AM UTC
  2. PowerBuilder
  3. # 2

Hi,

What you can try:

1. in the detail band, create a computed column with an "if" statement that has the value of the column that you want to sum if the group value is a "blank" and which holds a 0 value when it's not. Let's say you name it "cc_value_blank".

2. In the group summary you create another computed column which sums all the values of "cc_value_blank" for that group. Let's say you name it "cc_total_blank"

3. for the other totals you can then create a computed column that sums the values that you want to sum and add the "cc_total_blank" to it.

 You might have to do a GroupCalc() or Sort() from code, since the different computed columns are referencing each other.

I think it should work, but am not a 100% sure.

regards

 

 

Comment
  1. Miguel Leeuwe
  2. Friday, 2 June 2023 08:02 AM UTC
I forgot to say that you can make the computed columns that you don't want to see invisible.
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Friday, 2 June 2023 01:56 AM UTC
  2. PowerBuilder
  3. # 3

Hi, Raymond -

I would construct the desired result set in a stored procedure and use that stored procedure as the data source for the group-style DataWindow.

Best regards, John

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.