Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

OBTENER EL LAS VENTAS DEL AÑO ANTERIOR DEL MISMO DIA DEL TODAY

=((SUM({$<CAL_ANIO=,CAL_MES=,CAL_DIA=,CAL_DIA_SEMANA=,CAL_SEMANA=,CAL_FECHA=,

CAL_ANIO={$(=YEAR(TODAY())-1)},CAL_MES={$(=MONTH(TODAY()))},CAL_DIA={$(=DAY(varAyer))} >}

ARV_IMPORTE_CON_IVA))/1000)/(varPtcVta+.1)

el problema es cuando hay cambio de mes

6 Replies
Not applicable
Author

Hola Oreff, en vez de usar la función Today() puedes usar el mes que estén seleccionando como pivote, así si cambian de mes como lo comentan, cambiará también tu fórmula, puedes usar la función Max del mes que estén seleccionando:

=((SUM({$<CAL_ANIO=,CAL_MES=,CAL_DIA=,CAL_DIA_SEMANA=,CAL_SEMANA=,CAL_FECHA=,

CAL_ANIO={$(=YEAR(Max(CAL_ANIO))-1)},CAL_MES={$(=MONTH(Max(CAL_MES)))},CAL_DIA={$(=DAY(MAX(CAL_DIA)))} >}

ARV_IMPORTE_CON_IVA))/1000)/(varPtcVta+.1)

Not applicable
Author

gracias, Angel ya lo habia considerado, pero es un tacometro estatico al dia de ayer, no importan las selecciones , pero debo de compararlo con la misma fecha retail del año-1

spividori
Specialist
Specialist

Hola.

No has probado con la funcion addmonth(today()-1,-12).

Saludos.

Not applicable
Author

Si tu campo CAL_DIA lo que trae es exclusivamente el día (ej. 24), y no el día con el mes y año, entonces sí funciona lo que te comenté en mi anterior post pues si traduces la expresión quedaría así:

Fecha pivote: 1 / Marzo / 2011

=((SUM({$<CAL_ANIO=,CAL_MES=,CAL_DIA=,CAL_DIA_SEMANA=,CAL_SEMANA=,CAL_FECHA=,

CAL_ANIO={$(=YEAR(2011)-1)},CAL_MES={$(=MONTH(3))},CAL_DIA={$(=DAY(1))} >}

ARV_IMPORTE_CON_IVA))/1000)/(varPtcVta+.1)

Lo anterior te colocará la fórmula para el día 1/3/2010 el mismo dia de tu fecha pivote pero del año pasado.

Not applicable
Author

Sum({<CAL_ANIO={$(=Year(Today())-1)}, Dia={$(=Day(Today()))}>} Sales)

Anil_Babu_Samineni

Usted puede perder citas simples

=((SUM({$<CAL_ANIO=,CAL_MES=,CAL_DIA=,CAL_DIA_SEMANA=,CAL_SEMANA=,CAL_FECHA=,

CAL_ANIO={'$(=YEAR(TODAY())-1)'},CAL_MES={'$(=MONTH(TODAY()))'},CAL_DIA={'$(=DAY(varAyer))'} >}

ARV_IMPORTE_CON_IVA))/1000)/(varPtcVta+.1)


What was that varPtcVta Variable?? then you need ($(varPtcVta) + 0.1)

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)