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

Expressão com multiplicação dependendo do resultado

Olá, boa tarde a todos.

tenho uma tabela, com seguintes campos - NR_CRACHA, NM_FUNC, VL_SALARIO-, como visto, preciso mostrar os dados citados, mas existe um porém, tenho três tipos de salário, mensal, diário e horista...

TIPOS_SALARIO:

ID_TIPO_SALARIO - DS_TIPO_SALARIO

311 - Mensal

331 - Diário

351 - Horista

Na tabela citada, no campo VL_SALARIO, quando for Mensal, mostro VL_SALARIO, quando for DIÁRIO preciso multiplicar por 30, quando for HORISTA, preciso Multiplicar por 6 (horas diárias) e por 30 (dias)...

Como faço isso?

Obrigado, desde já.

Marcos.

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

Talvez:

VL_SALARIO * pick(MATCH(ID_TIPO_SALARIO ,311,331,351),1,30,30*6)

View solution in original post

3 Replies
alexandros17
Partner - Champion III
Partner - Champion III

In the table with fields

NR_CRACHA, NM_FUNC, VL_SALARIO

where is there a reference to ID_TIPO_SALARIO?

If it exists then when you load the table yoc can use an If condition otherwise you need to apply the logic in the front end (in the chart, with an expression)

let me know

Clever_Anjos
Employee
Employee

Talvez:

VL_SALARIO * pick(MATCH(ID_TIPO_SALARIO ,311,331,351),1,30,30*6)

Anonymous
Not applicable
Author

Perfeito Clever, obrigado.

Marcos.