Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I need to reuse the previous month value in current month. How I can achieve this please suggest.
For Example:
Closing | Monthend |
Mar-18 No. of Emp | 640 |
Apr-18 No. of Emp | 641 |
May-18 No. of Emp | 638 |
Jun-18 No. of Emp | 640 |
Jul-18 No. of Emp | 675 |
Aug-18 No. of Emp | 681 |
Sep-18 No. of Emp | 679 |
Oct-18 No. of Emp | 678 |
Nov-18 No. of Emp | 677 |
Dec-18 No. of Emp | 679 |
Jan-19 No. of Emp | 698 |
Feb-19 No. of Emp | 699 |
Mar-19 No. of Emp | 698 |
I have the data for March'18 to March'19.
Now I need the output as below
Opening | Monthend |
Mar-18 No. of Emp | - |
Apr-18 No. of Emp | 640 |
May-18 No. of Emp | 641 |
Jun-18 No. of Emp | 638 |
Jul-18 No. of Emp | 640 |
Aug-18 No. of Emp | 675 |
Sep-18 No. of Emp | 681 |
Oct-18 No. of Emp | 679 |
Nov-18 No. of Emp | 678 |
Dec-18 No. of Emp | 677 |
Jan-19 No. of Emp | 679 |
Feb-19 No. of Emp | 698 |
Mar-19 No. of Emp | 699 |
Apr-19 No. of Emp | 698 |
Please suggest how i can achieve this.
Thanks in advance.
If handling this in front end then @mcsshg2011 is probably the way to go, but if you are able to manipulate the script then you have two possible solutions.
Manipulating the header by adding one month:
Data
LOAD Closing, Capitalize(Date(MonthName(date#(Subfield(Closing, ' ',1), 'MMM-YY') , 1), 'MMM-YY')) & ' No. of Emp' as Opening, Monthend FROM [https://community.qlik.com/t5/New-to-Qlik-Sense/Getting-Preevious-Month-Data-in-Current-Month/m-p/1571887#M133387] (html, codepage is 1252, embedded labels, table is @1);
Reading the previous loaded data:
By fetching the Monthly amount from the previous line read you are able to get the previous month value, but you wont get a value for 'Apr-19 No. of Emp' as it is not in your data. It is also important that you are able to sort your input data correctly, hence it is reading the previous line.