Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to use if condition here

I am taking two expressions in one field

'I: '& sum({<LineId={'25'},Number={'I*'}>} Units)

   &' '

   &' F: '& sum({<LineId={'25'},Number={'F*'}>} Units)

My result in table is

I: 0  F: 3

now i should not show I: 0 because it is having 0 value.

can anyone help me in writing this expression

thanks in advance.

2 Replies
its_anandrjs

You can try with

if( sum({<LineId={'25'},Number={'I*'}>} Units) = 0 ,' '&F: '& sum({<LineId={'25'},Number={'F*'}>} Units),


'I: '& sum({<LineId={'25'},Number={'I*'}>} Units)&' '&' F: '& sum({<LineId={'25'},Number={'F*'}>} Units)

Or

if( sum({<LineId={'25'},Number={'I*'}>} Units) = 0 ,F: '& sum({<LineId={'25'},Number={'F*'}>} Units),


'I: '& sum({<LineId={'25'},Number={'I*'}>} Units)&' '&' F: '& sum({<LineId={'25'},Number={'F*'}>} Units)


Anonymous
Not applicable
Author

Here's the expression if the same rule applies to F:

=IF(sum({<LineId={'25'},Number={'I*'}>} Units) <> 0,

       IF(sum({<LineId={'25'},Number={'F*'}>} Units) <> 0,

            'I: '& sum({<LineId={'25'},Number={'I*'}>} Units) & ' F: '& sum({<LineId={'25'},Number={'F*'}>} Units),

            'I: '& sum({<LineId={'25'},Number={'I*'}>} Units)

            )

       IF(sum({<LineId={'25'},Number={'F*'}>} Units) <> 0,

            'F: '& sum({<LineId={'25'},Number={'F*'}>} Units),

            null()

            )

       )