Hello, i have a problema with if sentece in Report Studio.
In DB data they are as follows:
episodio Num_urgencia NUM_UG_CON_INGRESO NUM_UG_SIN_INGRESO HORAS_DURACION_URGENCIA
1 1 1 0 5
2 1 0 1 3
3 1 0 1 5
4 1 0 1 6
5 1 0 1 2
I want to get the emergency number without income 4 hours have passed and it created a data item with the following if:
if (HORAS_DURACION_URGENCIA> 4) then (NUM_URG_SIN_INGRESO) else (0) -> this with the data above should give me 2
The problem is that you are returning me 4 being the total NUM_UG_SIN_INGRESO and gives me the impression that it is because I is adding the total number of hours of urgency, and of course me exceed 4 and returns the total of NUM_UG_SIN_INGRESO.
Do you have any idea why he is behaving like this?
Thank you very much.
Quote from: Sus on 19 Oct 2016 08:10:17 AM
Hello, i have a problema with if sentece in Report Studio.
In DB data they are as follows:
episodio Num_urgencia NUM_UG_CON_INGRESO NUM_UG_SIN_INGRESO HORAS_DURACION_URGENCIA
1 1 1 0 5
2 1 0 1 3
3 1 0 1 5
4 1 0 1 6
5 1 0 1 2
I want to get the emergency number without income 4 hours have passed and it created a data item with the following if:
if (HORAS_DURACION_URGENCIA> 4) then (NUM_URG_SIN_INGRESO) else (0) -> this with the data above should give me 2
The problem is that you are returning me 4 being the total NUM_UG_SIN_INGRESO and gives me the impression that it is because I is adding the total number of hours of urgency, and of course me exceed 4 and returns the total of NUM_UG_SIN_INGRESO.
Do you have any idea why he is behaving like this?
Thank you very much.
So this is a query calculation? Can you be specific about the syntax you used. Was it
if ([HORAS_DURACION_URGENCIA] > 4) then ([NUM_URG_SIN_INGRESO]) else (0)
or was it
if ([your package].[your query subject].[HORAS_DURACION_URGENCIA] > 4) then ([your package].[your query subject].[NUM_URG_SIN_INGRESO]) else (0)
The former applies if you brought in the items from the query, and the latter applies if you brought in the items from the package.
The difference between the two is the timing of the calculation. The former is applied after the default aggregation occurs. The latter is applied before the default aggregation occurs. I think this is what you need here?
Regards,
MF.
Thank's !!! it is the solution!!