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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

To find Sum of changes in Orders

Hello Guys,

I need your help.

I have a table like this

table1:

Load Ordernr,

Matnr

from x.qvd(qvd)

order by

Ordernr;

I need first to verify if a ordernr is equal to previous order in the table. If it is same then the Total Nr of changes = 0 and if it changes in comparision to previous it must be 1

I need at the end the sum of changes in my orders for a specified week or Month.

Any ideas??

Thanks in advance

1 Reply
fernandotoledo
Partner - Specialist
Partner - Specialist

You shoud try Previous() as follows:


ORDER_TMP:
LOAD
ORDERNR,
MATNR
FROM X.QVD (QVD);

ORDER:
LOAD
ORDERNR,
MATNR,
IF(ORDERNR = PREVIOUS(ORDERNR),0,1) AS ORDER_CHANGE
RESIDENT ORDER_TM;

DROP TABLE ORDER_TMP;