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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Current Month and Prior Month in a new column

Hi dear,

How can i do it below?

Current State
KEYMONTHPRODUCT
10012012/01A
10012012/02A1
10012012/03XX

New State (that i need to do)

KEYMONTHPRODUCT PRIOR PRODUCT
10012012/01A
10012012/02A1A
10012012/03XXA1

Thank you

1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

In a straight table or pivot chart you can use the above() function: above(PRODUCT)

In the script you can use the previous() function: if(KEY=previous(KEY),previous(PRODUCT)) as PRIOR PRODUCT. You may have to create another table first if your source data isn't sorted on KEY first and MONTH next.


talk is cheap, supply exceeds demand