Home > database >  Calculation of the column value to replace the data window
Calculation of the column value to replace the data window

Time:09-18

In PB data window, a calculated column (C), is the product of the first two columns automatically (a and b), after calculating the column and a column (d), and now want to if there are data under the condition of d column, in the preservation of the C column value, that is to say d as the column C and d column values, C column is no longer displayed as the calculated value of a column and column b,
I write in the calculation expression of column c
If (d> 0, d, round (a * b, 2)) to expecting true/false expression can't save, what is wrong?
Among them a is dec, b type is money, d type is dec, c is to compute the column,

CodePudding user response:

refer to the original poster winner_diao response:
in PB data window, a calculated column (C), is the product of the first two columns automatically (a and b), after calculating the column and a column (d), and now want to if there are data under the condition of d column, in the preservation of the C column value, that is to say d as the column C and d column values, C column is no longer displayed as the calculated value of a column and column b,
I write in the calculation expression of column c
If (d> 0, d, round (a * b, 2)) to expecting true/false expression can't save, what is wrong?
Among them a is dec, b type is money, d type is dec, c is compute columns,


See the error prompt should be d & gt; 0 this place, doubt your type is not correct, you carefully check this a few types of columns, true not line, to build a data window, you only use this column to try again

CodePudding user response:

If (d<0 or isnull (d), round (2) a *, b, d)

CodePudding user response:

If (d<0 or isnull (d), round (2) a *, b, d)

CodePudding user response:

Cautious doubt you d column type of type string, if it is a string type:
If (IsNumber (d), the if (dec (d) & gt; 0, d, round (a * b, 2)), round (a * b, 2))

CodePudding user response:

A column and column b d columns cannot be null

CodePudding user response:

I had a try, no problem, may is a data type,

CodePudding user response:

Among them a is dec, b type is money, d type is money, c is compute columns, not null

CodePudding user response:

refer to 7th floor winner_diao response:
with a is dec type, type b is money, d type is money, c is compute columns, not null


Try to do a data window, if not, are replaced by dec

CodePudding user response:

This want to do a loop when saved, from the first line to the last line, line replacement is ok, remember at the time of preservation,
  • Related