Hello All,
I am trying to place a โtextโ value in โdecimalโ column with a IF expresiรณn but I am getting an error.
Expresion:
IF((SUM(SELECT(registros[pH], AND([_THISROW].[Punto de Muestreo]=[Punto de Muestreo],[Hora Fecha Inicio]>=[_THISROW].[Rango Fecha Inicio],[Hora Fecha Final]<=[_THISROW].[Rango Fecha Final]))) > 0), AVERAGE(SELECT(registros[pH], AND([_THISROW].[Punto de Muestreo]=[Punto de Muestreo],[Hora Fecha Inicio]>=[_THISROW].[Rango Fecha Inicio],[Hora Fecha Final]<=[_THISROW].[Rango Fecha Final]))), โNAโ)
Error:
Value โNAโ in field โpH (Pro)โ cannot be converted to type โDecimalโ.
Any insight would be appreciated.
PD. I tried set the column type to โTEXTโ but it generates another issue:
does not work with the โShow_Ifโ expression:
[pH (Pro)] > 0
You canโt put text values into a Number or Decimal column.
You can maybe use
DECIMAL( [pD (Pro)] ) > 0
Thanks @Marc_Dillon , this worked. How would I set it to 2 decimal places?
Are you asking how to validate a Decimal value in a Text column to 2 decimal places?
Yes
ok.
First, I think youโre going to keep running into issues by putting decimal values in a text column, so I donโt really recommend that you continue with this.
But if you insist, perhaps this:
Valid_If =
LEN( INDEX( SPLIT( [_THIS] , "." ) ,2 ) = 2
Thanks again, @Marc_Dillon , I took your advise. The whole topic arose with reporting โ0โ which after your feedback I decided to leave things how they where and solved it at the report level:
<<IF([pH (Pro)] = 0, โNAโ, [pH (Pro)]) >>
User | Count |
---|---|
25 | |
24 | |
24 | |
23 | |
16 |