# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Contributor

## round() with if logic help

Hi Experts,

here profitloss  and limitusage are fields.

round(abs(

case

when profitloss = 'Y' then least(sum(  [limitusage] )  , 0)

else

sum( [limitusage] )

end)  , 2 )

1 Solution

Accepted Solutions
MVP

## Re: round() with if logic help

May be this

Round(Fabs(If(Profitloss = 'Y', RangeMin(Sum(limitusage), 0), Sum(limitusage))), 0.01)

4 Replies
MVP

## Re: round() with if logic help

May be like this

Round(Fabs(If(Profitloss = 'Y', RangeMin(Sum(limitusage), 0), Sum(limitusage))))

Contributor

## Re: round() with if logic help

Hi Sunny,

Thanks for your reply its rounding by 2 digits where to apply 2 in your expression also in the query mentioned abs not fabs.

round(abs(

case

when profitloss = 'Y' then least(sum(  [limitusage] )  , 0)

else

sum( [limitusage] )

end)  , 2 )

MVP

## Re: round() with if logic help

May be this

Round(Fabs(If(Profitloss = 'Y', RangeMin(Sum(limitusage), 0), Sum(limitusage))), 0.01)

Contributor

## Re: round() with if logic help

Thanks sunny its working...