Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
mahitham
Creator II
Creator II

round() help

Hi Experts,

Can any one please help me to convert below oracle decode function into Qlik UI as expression.

round( Sum ( decode ( [name] , 'valuerisk', [Value] ,0 ) ) /1000, 2 )

Here name and Value are the fields.

jontydkpicould you please help me.

Thnaks in advance.

1 Solution

Accepted Solutions
keerthika
Creator II
Creator II

Hi Mahitha,

=round(sum(if(WildMatch([name],'valuerisk'),[value],0))/1000,2)

use this expression and tel me what answer are you getting

View solution in original post

5 Replies
keerthika
Creator II
Creator II

Hi,

Try this and see,

=round(sum(if(WildMatch([name],'valuerisk'),'1',  if(WildMatch([value],'0'),'2','9'  )))/2,2)


Regards,

keerthika

mahitham
Creator II
Creator II
Author

Hi Keerhtika,

Thanks for your reply.

I did not understand which you have mentioned ,'2','9' could you please explain once.

keerthika
Creator II
Creator II

Hi,

In oracle decode function syntax is

decode(column name,'100','IBM',

                                    '200','Microsoft',

                                    'others')

if the column name is 100 it display IBM, if it is 200 it display Microsoft otherwise 'others'

Like that

=round(sum(if(WildMatch([name],'valuerisk'),'1',  if(WildMatch([value],'0'),'2','9'  )))/2,2)

in the above expression if [name] is 'valuerisk' it will display 1 , if value is 0 it will display 2 otherwise 9.


Is this way you are expecting?

mahitham
Creator II
Creator II
Author

Hi Keerthika,

I am new to oracle.

My output value is like -42.88 for one of the record but by the above expression I am getting 45.00.

I have used below one.

=round(sum(if(WildMatch([name],'valuerisk'),'1',  if(WildMatch([value],'0'),'2','9'  )))/2,0.01)

When I have selected value = 0 in the table this expression is showing 1.00 not 2 as per your expression.

keerthika
Creator II
Creator II

Hi Mahitha,

=round(sum(if(WildMatch([name],'valuerisk'),[value],0))/1000,2)

use this expression and tel me what answer are you getting