computed field expression

I have this statement but it is not producing the desired results.
I have 2 computed fields that are supposed to get the total amount for cash
and the total for credit.

compute_1: If( payment_payment_form <> 'cash', sum( payment_amount for
all),0)

compute_2: If ( payment_payment_form ='cash, sum( payment_amount for all),0)

Obviously this aboue just produces the total for both cash and credit.
I can't get the syntax right but I need something like;

If ( payment_payment_form ='cash, sum( payment_amount for all) where
payment_form = cash,0)

Any ideas?


0
MJN
11/6/2002 12:32:49 PM
sybase.powerbuilder.datawindow 28057 articles. 4 followers. Follow

2 Replies
567 Views

Similar Articles

[PageSpeed] 28

Didn't try this but should work:

compute_credit: sum(payment_amount * (If(payment_form <> 'cash', 1, 0) for 
all)

compute_cash: sum(payment_amount * (If(payment_form = 'cash', 1, 0) for 
all)

hth
0
lt
11/6/2002 1:35:33 PM
....remove ( in front of If( (;-)
0
lt
11/6/2002 2:05:29 PM
Reply:

Similar Artilces:

computed field of a computed field
Hello, I made nice datawindow with some aggregate functions to calculate a certain value at a group level. Now I want a grand total which gives me the sum of these values. Unfortunately this does not seem to be possible. So, when I have a computed field which is round (sum(file_field),0) located in the trailer band, I need a grand total of this field in the summary band. Does anyone know how to solve this ? Philip. Philip@acom.be (Belgium) Philip, in the group , you must have created a computed field having expression sum ( file_field ) for group 1 In the summery, y...

Datawindows and Computed Fields
I am using PB 8 and have several formatted datawindows providing reports for the end user. What has been requested of me and I am having trouble with is as follows. I have a datawindow with a nested datawindow. The main datawindow object contains the "parent" record and the nested one contains "child" records. Basically an Agency has subagencies. This report is to be used to create a manual. Where I am having the problem is that the page numbering is done using a computed field placed in the header (or footer or detail for that matter). I need to know the page...

Computed field expressions
Hi all, I have a problem with computed expressions. I am replacing occurence of a particular string in a computed field with another string( say from 'mm/dd/yy ' to 'dd/mm/yy') using powerscript and when I try to modify the expression it works in some cases and fails in other cases. For ex ls_syntax = ls_computename + ".Expression = " + "'"+ ls_expression + "'" this.modify(ls_syntax) In the above I get a Modify Syntax error in some cases. Therefore, I need a universal syntax that would work under all cases. Does a...

Computed field in a datawindow
How do I make a computed field in a datawindow editable? You can't. But you can create computed column. It has a tab order. Go to SQL painter of datawindow, go to computed, place 0 for number type of editable column, '' for string type of editable column -- Mahendra Dhamdhere, CPDA Email:nospam_mahendrad@hotmail.com Pl. Remove nospam_ from email id Shobana Juliana wrote: > How do I make a computed field in a datawindow editable? >How do I make a computed field in a datawindow editable? You don't. If you need for the user to be able to e...

Computed field expression: AND or OR
Hi all, Just had a strange problem. In a computed field expression I placed following statement: (Value of prc_discount = 0 ) - IF( NOT IsNull( prc_discount ) AND prc_discount <> 0, 'Show text', '' ) --> Result = 'Show text' Now by changing the expression to: - IF( IsNull( prc_discount ) OR prc_discount = 0, '', 'Show text' ) --> Result = '' Can someone explain this behaviour, because I'm totally lost. (PB 8.0.1 Build 9056 on a W2K workstation) TIA, PascalB Hi Pascal, just a shot in the dark: ...

Computed field in Datawindow
PB version: 6.5 A computed field in a datawindow have not a tab order. So, i can�t go to this field and do a 'Copy and Paste' of the value of this field. Thanks... try to use computed column, u can't use computed field for copy & paste as it does not have tab order, it is only for display. ...

Computing Computed Field
I Have a computed field in tailor band of a group. I tried to sum that computed field in summary band using another computed expression ..It is displaying 0 instead of sum I appreciated any help Thanks Sue IF you use the format sum(x for group 1) in Tailor group then use sum(x for all) in summary. Stephan Donati Fortisoft Corporation "Sue Sambireddy" <SSambireddy@bankofny.com> wrote in message news:3AE83A22.AF41D7BC@bankofny.com... > I Have a computed field in tailor band of a group. I tried to sum > that computed field in summary band using a...

Computing computed field
I Have a computed field in tailor band of a group. I tried to sum that computed field in summary band using another computed expression ..It is displaying 0 instead of sum . I appreciated any help Thanks Sue You can place the expression from the second field in the first one instead of referring to it. Another option (often works) is to apply the GroupCalc DataWindow method (of course outside the expression in the script where you issue Retrieve(), for example.). Sue Sambireddy wrote: > I Have a computed field in tailor band of a group. I tried to sum > t...

Computed Field not computing
I have a series of computed fields that calculate percentages and then a series that total those percentages. When I add the third total percentage field (out of four total) to my group trailer, all my total percentage fields sum to 0 when they should all sum to 100. If I move the third computed field into another band then they all sum to 100 and when I put it back they all still compute to 100. Why would this happen? I know computed fields constantly re-compute, but these are not initially computing correctly based on the number of computed fields present in my group trailer band...

summation of computed fields under datawindow
Just one quick & simple quesion. However, i do get stuck with this for a long time. How can i sum up the total of the computed fields? Example: ComField = sum (A for group 1) where A=column However, at the end of my report, i coded "sum(ComField for all)", i only got "0". Is there anyway syntax to sum the computed fields at the end of the report. Thanks in advance! Joe, You may have over-simplified your example, because you can just create a computed field with the expression "Sum (A for all)" and solve that particular problem. Is th...

Computed Field Expression #2
I have a computed field in the header band that I want to update with most current value of an instance variable. I am attempting to change the expression. It never displays. The modify statement returns an empty string showing me that the modify had no errors. What am I doing wrong and is there a better way to get an instance variable to display on a datawindow. Try a text object. It's simple. Just change the text. <DW Control Name>.Object.<Textname>.Text='<string>' -- Srinivas R. Loka "Rosalind Powell" <roz@brcf.org> wrote in m...

modify expressions in computed fields ?
Can i modify expressions in computed fields depends on the value in a column like other properties like color (exam: text.Color='0~t If (formel_id =1 ,255,0)' )?? thats my test_modstring: c_test.Expression='0~tIf(formel_id =1 ,1+1,0)' i have only Syntax error at the last column. Thank you very much! Sure you can. Off hand your syntax looks ok. Replace "forme1_id" with a constant and see if it accepts the syntax: '0~tIf(1=1 ,1+1,0)' First get it working in the DW painter. Then copy that syntax out and use it in your modify. Regards, John ...

Modifying Computed field Expression
Hello, We have a software package that we use in our business, where we have some control over customizations to the program. We don't have access to window objects, but we have access to certain datawindows and global functions. One global function runs when a window refreshes. The function contains a choose case statement to determine which window is opening. It then runs the script for that window. I have a computed field on a datawindow that just has an Expression of 0. I want to be able to have the Expression for the computed field get modified through this fun...

computed field conditional expression
Hi, I need to write a computed field to sum rows based on a condition, like a where clause. Like: sum( amount where level = 4) OR even better sum( amount where level = level), where 'level' and 'amount' are columns in the DW. Even though this computed field will be in the detail band, I want it to do some kind of grouping sum. I cant change the the expression for a row. TIA Sanjay Hi Geert, Thanks, I couldn't quite follow what you suggested. Could you elaborate. Let me elaborate. I want to sum a column lets say 'amount' and take only rows...

Web resources about - computed field expression - sybase.powerbuilder.datawindow

Closed-form expression - Wikipedia, the free encyclopedia
In mathematics , an expression is said to be a closed-form expression if it can be expressed analytically in terms of a finite number of certain ...

Joe Rogan's Facial Expression After Ronda Rousey Got Knocked Out Was Priceless - Bleacher Report
Joe Rogan 's face spoke for us all Saturday night. After UFC superstar Ronda Rousey got knocked out by a lethal kick from Holly Holm, the commentator ...

Jack Dorsey: 'Twitter stands for freedom of expression'
Newly-instated CEO Jack Dorsey laid out Twitter's commitment to open dialogue, in a keynote on stage at today's Twitter Flight developer conference ...

Make your technology a force for musical expression with this digital guitar
Computers, tablets, even iPhones have grown into powerful tools for music making, but for many who play guitar the bridge from analog instrument ...

Computers learn how to spot hidden facial expressions
Machines are good at spotting obvious emotions like smiles, but they're not so hot at detecting the extremely brief microexpressions that reveal ...

Turkey's YouTube Ban Violated Freedom Of Expression, European Court Rules
A YouTube ban in Turkey that lasted two years has now been ruled a violation of the European Convention on Human Rights. Back in 2008, a Turkish ...

Smile!: Impressive Real-Time Facial Expression Transfer
This is a video from Stanford University of a system developed to transfer one person's facial expressions in real time to a live video feed ...

How Facial Recognition Uses Super-Simple Patterns to Understand Your Expression
Facial recognition systems use all kinds of clever software to work out who you are and even how you’re feeling. But in this video explainer, ...

Expressions of Solidarity for France in Red, White and Blue
ABC News Expressions of Solidarity for France in Red, White and Blue ABC News This photograph made available on Saturday Nov. 14, 2015, shows ...

Black Activist Shows His Freedom Of Expression By Punching Christian Preacher In University Of Missouri’s ...
A black activist at the University of Missouri showed his “freedom of expression” towards a Christian pastor who was in the midst of protests. ...

Resources last updated: 12/13/2015 3:25:03 AM