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: 
Not applicable

Peek function problem

Hi, I'm trying to calculate Delta of Sales between adjacent months but it always compare with Month number 12

Ventas_Mes. Here is the whole script, any idea? Thanks in advance!:

LOAD * INLINE [

    Mes, Ventas

    5, 32

    3, 34

    2, 2

    4, 44

    1, 65

    7, 88

    6, 56

    8, 44

    9, 12

    12, 23

    11, 33

    10, 45

]
;





NoConcatenate



VentasMesesOrdenados:

LOAD

Mes,

Ventas

RESIDENT Ventas_Mes

Order by Mes Asc;



drop Table Ventas_Mes;



LOAD

Mes &'-'&Peek('Mes',-1,'VentasMesesOrdenados') as DeltaMes,

Ventas - Peek('Ventas',-1,'VentasMesesOrdenados') as DeltaVentas

Resident VentasMesesOrdenados;









2 Replies
Not applicable
Author

Hola Tatiana,

Hablas español? Tu script funciona. mejor escribeme en este idioma para entender mejor tu problema.

Saludos,

Ricardo

Not applicable
Author

Adjunto un fichero con la solucion