Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
cristianj23a
Partner - Creator III
Partner - Creator III

Using the Below () statement

Hi.

Mainly I have a table with the CESADOS and ACTIVOS columns.

Captura.PNG

Then we divide CESADOS / ACTIVOS.

Captura.PNG

But there was a case, that CESADO has to go back one row to do the calculation CESADO / ACTIVOS.Use the BELOW () sentence,

to go back a row in CESADO.

Captura.PNG

So far so good, but when I select a day, no value appears.

select:

Mes: ene

Día:4

Captura.PNG

You must obtain.

Captura.PNG

I am using the BELOW () statement so that the values of CESADOS, go back one day or row.

Please help me get that value when I select a day.

Like when I select a Month, I would like to obtain the average of Assets, Cesados and the percentage.

Captura.PNG

Mes = 'ene'

The average of

CESADOS = 49

ACTIVOS = 8291

Below(CESADO)/ACTIVO = 0.60%

I attach the Qvw y Xls.

https://www.linkedin.com/in/cristianjorge/
Do not forget to mark as "Accepted Solution" the comment that resolves the doubt.
9 Replies
sunny_talwar

Try this

Below(Only({<Mes, Día>}Cesado))/Only({<Mes, Día>}Activos) * Avg(1)

Removing sort by expression on the sort tab... or ignore selection in sort expressions also

Capture.PNG

cristianj23a
Partner - Creator III
Partner - Creator III
Author

Hi Sunny.

Sorry for posting several times.

Thanks, it works.

But not in the Real Application.

The real logic for Cesado is.

IF(GetSelectedCount (Día)=1,


Below(

(COUNT({<%FILTRO_ACTIVOS={'CESADO'},[Motivo Cese]={'*'}-{''}>} [PA0000.Número de personal_PERNR]))

-(COUNT({<%FILTRO_ACTIVOS={'CESADO'},%flag_4d_abs={'1'},[Motivo Cese]>}[PA0000.Número de personal_PERNR]))

)

,

Avg(

AGGR(

Below(

(COUNT({<%FILTRO_ACTIVOS={'CESADO'},[Motivo Cese]={'*'}-{''}>} [PA0000.Número de personal_PERNR]))

-(COUNT({<%FILTRO_ACTIVOS={'CESADO'},%flag_4d_abs={'1'},[Motivo Cese]>}[PA0000.Número de personal_PERNR]))

),PA0000.Fecha))//COUNT(distinct {<DíaSemana={'*'}-{'dom'}>} PA0000.Fecha)

)

that logic helps me to go back one row in the table.

Captura.PNG

When I select a day, the information is deleted.

Captura.PNG

Is there any logic that I keep that value in the table, when I select a day?

I'm also trying to display the values in a text object.

Captura.PNG

Greetings.

Attached the Qvw,

https://www.linkedin.com/in/cristianjorge/
Do not forget to mark as "Accepted Solution" the comment that resolves the doubt.
sunny_talwar

Check attached for table...

Capture.PNG

For the text box object... what would you want to see when nothing is selected?

cristianj23a
Partner - Creator III
Partner - Creator III
Author

Thanks Sunny.

In the qvw that you attach, it is a summary of the true application.

The analysis is carried out annually, monthly and daily.

If you do not select anything, the cessation of each year should appear.

The logic is similar to the calculation of assets (The calculation is a daily average), only that in cesados they go back a day or a row and that does not work for me.

Captura.PNG

https://www.linkedin.com/in/cristianjorge/
Do not forget to mark as "Accepted Solution" the comment that resolves the doubt.
sunny_talwar

Try this

=Num(Avg(Aggr(

IF(GetSelectedCount (Día)=1,


Below(

(COUNT({<%FILTRO_ACTIVOS={'CESADO'},[Motivo Cese]={'*'}-{''}, Mes, Día>} [PA0000.Número de personal_PERNR]))

-(COUNT({<%FILTRO_ACTIVOS={'CESADO'},%flag_4d_abs={'1'},[Motivo Cese], Mes, Día>}[PA0000.Número de personal_PERNR]))

) * Avg(1)

,

Avg(

AGGR(

Below(

(COUNT({<%FILTRO_ACTIVOS={'CESADO'},[Motivo Cese]={'*'}-{''}, Mes, Día>} [PA0000.Número de personal_PERNR]))

-(COUNT({<%FILTRO_ACTIVOS={'CESADO'},%flag_4d_abs={'1'},[Motivo Cese], Mes, Día>}[PA0000.Número de personal_PERNR]))

),PA0000.Fecha))//COUNT(distinct {<DíaSemana={'*'}-{'dom'}>} PA0000.Fecha)


)

/

IF(GetSelectedCount (Día)=1,


(

(COUNT(distinct {<PA0000.DíaSemana-={'dom'},%FILTRO_ACTIVOS={'ACTIVO'},[Tipo Ausentismo],SEDE-={' '}, Mes, Día>} [PA0000.Número de personal_PERNR]))-

sum({<Mes, Día>}aggr(

sum({<Mes, Día>}if(PA0000.Fecha>=date([PA2001.Inicio de validez_BEGDA]+4,'DD/MM/YYYY') and PA0000.DíaSemana<>'dom' and %FILTRO_ACTIVOS='ACTIVO' and SEDE<>' ',

[PA2001.EXP1_Días presenc./abs._ABWTG]))

,[PA0000.Número de personal_PERNR],PA0000.Fecha,[PA2001.Inicio de validez_BEGDA]))

)

,


sum({<Mes, Día>}aggr(

((COUNT(distinct {<PA0000.DíaSemana-={'dom'},%FILTRO_ACTIVOS={'ACTIVO'},[Tipo Ausentismo],SEDE-={' '}, Mes, Día>} [PA0000.Número de personal_PERNR]))-

sum({<Mes, Día>}aggr(

sum({<Mes, Día>if(PA0000.Fecha>=date([PA2001.Inicio de validez_BEGDA]+4,'DD/MM/YYYY') and PA0000.DíaSemana<>'dom' and %FILTRO_ACTIVOS='ACTIVO' and SEDE<>' ',

[PA2001.EXP1_Días presenc./abs._ABWTG]))

,[PA0000.Número de personal_PERNR],PA0000.Fecha,[PA2001.Inicio de validez_BEGDA])))

,PA0000.Fecha))

/count(distinct {<PA0000.DíaSemana-={'dom'}, Mes, Día>} PA0000.Fecha))


, Mes, Día)), '##.##%')

Without selection

Capture.PNG

With Selection

Capture.PNG

cristianj23a
Partner - Creator III
Partner - Creator III
Author

Tanks You Sunny.

One last query.

Is it possible to get those values but divided by SEDE,Und.OrganizativaDesc,[Tipo Empleado Desc] and others dimesiones? Example.

Captura.PNG

This problem happened to me from the beginning.

In these two graphical data, the same information should appear but divided by SEDE,Und.OrganizativaDesc,[Tipo Empleado Desc]

Captura.PNG

https://www.linkedin.com/in/cristianjorge/
Do not forget to mark as "Accepted Solution" the comment that resolves the doubt.
sunny_talwar

Don't think I follow?

cristianj23a
Partner - Creator III
Partner - Creator III
Author

I got stuck with this topic. Please help me this part to close.

https://www.linkedin.com/in/cristianjorge/
Do not forget to mark as "Accepted Solution" the comment that resolves the doubt.
sunny_talwar

But I am not sure I understand what you are looking to get