Home > database >  PB data window to change the calculation of the column value
PB data window to change the calculation of the column value

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,

CodePudding user response:

If (isnumber (d), d, a * b)

CodePudding user response:

C column calculation by the if processing, when countless according to d=a * b, there are data=d, namely the if (d> 0, d, a * b)

CodePudding user response:

reference 1st floor opet98765 response:
if (isnumber (d), d, a * b)


This is the general idea:
C, the expression of the computed columns for: the if (isnumber (d), dec (d), a * b)

Want to use the DW objects of built-in data type conversion function, conversion after D data types and a * b is the same, otherwise an error,

CodePudding user response:

If you want to save the computed columns C, need to use stored procedures or write processing program code,

CodePudding user response:

Three columns a, b, d is dec type, without judgment, c columns are computed columns (sum (round (a * b, 2)), is to want to after the d input values, c column display is no longer the product of a and b, but d column input digital,
Because sometimes the inside of the column b value is through the d column divided by a column, the calculated, if the c column or automatically calculate a * b, the result will and d column input digital some small error,

CodePudding user response:

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

CodePudding user response:

refer to 6th floor winner_diao response:
I write inside the calculation expression of column c
If (d> 0, d, round (a * b, 2)) to expecting true/false expression cannot keep



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
  • Related