I am populating a DataWindow with some data. Some of the column names are "Request No", "Status", etc.
"Status" column can contain values like "Pending", "Active","Expired".
Whenever the DataWindow is populated I want to count the number of records in PowerBuilder which are having status as "Active".
After getting the count of the records I will be populating the count in some static text.
Can anybody help me , how to achieve this, as I am new to PowerBuilder.
Thanks
This will get you your answer, but it introduces you to what we PowerBuilder developers know as "Tilde Hell".
The tilde-craziness has to do with what each level of string evaluation boils the expression down to for the next evaluation. (~~ boils down to ~, and ~" boils down to " which is useful if your string is enclosed in double quotes)
Evaluate(<expression>, <row>)
inside aDescribe()
will return the value for<expression>
on a given row. (Since<row>
is irrelevant to asum()
operation which works across the full data set, all you need to do is make sure it's a valid row, i.e. in this example, that there is at least one row.)Good luck,
Terry.