Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Reemplazar Nulos en una Expresión

Hola,

Tengo la siguiente expresión:

NUM (SUM({<[COUNTRY DQ] = {'ESPAÑA'}, [BUSINESS DB DQ]= {'CREDIT'}>}[INDEX DATA Q]),'#,%')


Y quiero que cuando sea 0, me ponga N/A.


He intentando lo siguiente pero no funciona:

=if(IsNull(NUM (SUM({<[COUNTRY DQ] = {'ESPAÑA'}, [BUSINESS DB DQ]= {'CREDIT'}>}[INDEX DATA Q]),'#,%')), 'N/A', NUM (SUM({<[COUNTRY DQ] = {'ESPAÑA'}, [BUSINESS DB DQ]= {'CREDIT'}>}[INDEX DATA Q]),'#,%'))

Tb he intentado formular en el script que para todos los valores que haya nulos me ponga N/A:

NullAsValue *;

SET NullValue='N/A';

Como debería hacerlo?? Lo más correcto me parece modificar en el script para que me sirva para todas mis expresiones.

Gracias,

----------------------------------------------------ENGLISH-------------------------------------------------------------------------------------------

I have the following expression:

NUM (SUM ({<[COUNTRY DQ] = {'SPAIN'}, [BUSINESS DB DQ] = {'CREDIT'}}} [INDEX DATA Q], '#,%')

And I want it to be 0 when I get N / A.

I'm trying the following but it does not work:

=if(IsNull(NUM (SUM({<[COUNTRY DQ] = {'ESPAÑA'}, [BUSINESS DB DQ]= {'CREDIT'}>}[INDEX DATA Q]),'#,%')), 'N/A', NUM (SUM({<[COUNTRY DQ] = {'ESPAÑA'}, [BUSINESS DB DQ]= {'CREDIT'}>}[INDEX DATA Q]),'#,%'))

I tried to formulate in the script that for all values ​​that have been null and I put N / A:

NullAsValue *;
SET NullValue = 'N / A';

What can I do? The most correct thing seems to me to modify in the script so that it serves me for all the expressions.


Thanks

7 Replies
sunny_talwar

May be this

Num(If(IsNum(Sum({<[COUNTRY DQ] = {'SPAIN'}, [BUSINESS DB DQ] = {'CREDIT'}>} [INDEX DATA Q]), Sum({<[COUNTRY DQ] = {'SPAIN'}, [BUSINESS DB DQ] = {'CREDIT'}>} [INDEX DATA Q]), 0), '#,%')

Not applicable
Author

Your expression doesn't work.

sunny_talwar

You want to see 0 or N/A in your table?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

AFAIK Sum() always returns something, except when there is no data at all to feed the sum function (missing dimension values). How are you going to test for Null if Sum() always returns 0?

Not applicable
Author

i want to see N/A

Not applicable
Author

I want to put N/A when there are no data.

sunny_talwar

May be this

If(Sum({<[COUNTRY DQ] = {'SPAIN'}, [BUSINESS DB DQ] = {'CREDIT'}>} [INDEX DATA Q]) > 0, Num(Sum({<[COUNTRY DQ] = {'SPAIN'}, [BUSINESS DB DQ] = {'CREDIT'}>} [INDEX DATA Q]), '#,%'), 'N/A')