Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi community,
How would I make an if statement for not null and not 0? Here's what I'm trying now:
if(full_value<>0 and 'full_value<>'',full_value)
Regards,
Brandon
Hi Brandon,
You can write if statement like the below way
if
(
your dimension <>0
and
isnull(your dimension) =0,
statement1,
statement2
)
and for set analysis:
sum({<your_dimension-=0,isnull(your_dimension)=0>}expression/dimension).
hope this helps.
thank you
Meher
Hi Brandon,
You can write if statement like the below way
if
(
your dimension <>0
and
isnull(your dimension) =0,
statement1,
statement2
)
and for set analysis:
sum({<your_dimension-=0,isnull(your_dimension)=0>}expression/dimension).
hope this helps.
thank you
Meher
Hi
You can check the null like below:
if(full_value<>0 and isnull(full_value)=0,full_value)
Btw, if it is a numeric field then the following may also do the work:
if(full_value>0,full_value)
Best regards,
the set analysis not zero -=0 isn't working for me. I remember something like this in the past.
I copied and pasted your code into my document, but it still give s me the big minus sign rather than the little dash.
Is that the problem you think and how would I make the little dash with my keyboard?
You know why? Its because I needed not equal to in an if statement within the set analysis. Here I can use <>.
My example:
sum({ $< QBbalcode={'DIRMATL'},
//QB33={'2001'},
//LinkYear={$(=Only("CurrentDocumentYear"))},
//LinkMonth=CurrentDocumentMonth3,
[code3]={'RBIACCT'}
>}full_value)
/
( count({ $< QBbalcode={'DIRMATL'},
//QB33={'2001'},
//LinkYear={$(=Only("CurrentDocumentYear"))},
//LinkMonth=CurrentDocumentMonth3,
[code3]={'RBIACCT'}
>}if(full_value<>0,full_value))
/
count({ $< QBbalcode={'DIRMATL'},
//QB33={'2001'},
//LinkYear={$(=Only("CurrentDocumentYear"))},
//LinkMonth=CurrentDocumentMonth3,
[code3]={'RBIACCT'}
>}distinct(if(full_value<>0,full_value)))
)
I just started thinking about the solution for ur question.
If it's working then it's great. thanks for saving my time.
If possible can you mark the question as answered so that it helps others to save time.
let me know if you got any issues in this case.
thank you
Meher