Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
rcorcoran
Creator
Creator

Trying to get previous

 

HI

I am trying to put this in the script to have a field showing outturn as the previous year to the year selected.  Can anyone help??

Thanks

if(MetricKey =10 and ReferredMM=12 and ReferredYYYY= (ReferredYYYY)-1,MetricKey) as Outturn

3 Replies
tresesco
MVP
MVP

This is not enough information to help you. However, I guess you if you are thinking of joining the new field to the existing table, you have to basically use the following logic:

Table1:

Load

          Year,

          Data

From <>;

Join

Load

          Year-1 as Year

           Data as PreData

Resident Table1;  

rcorcoran
Creator
Creator
Author

Ok

I am sorry but I have a table as follows

I want the table to show a field before January only that has the figure from the December of the previous year in it as an out turn figure.  I have tried to put it in expressions but it shows up as a column beside each month with the figures at the end in for december but I just want 1 column with the december figure in it before January.

Thanks

ServiceProviderMonthJanFebMarAprMayJuneJulyAugSeptOctNovDec
Adelaide & Meath Hospital Inc NCH (HIPE) 28.631.627.421.416.016.915.918.820.315.116.913.0
Bantry General Hospital 12.614.313.421.983.39.515.412.312.813.514.935.1
Beaumont Hospital 41.237.334.227.823.325.223.522.419.418.120.321.7
Cappagh National Orthopaedic Hospital 7.037.50.00.00.00.00.00.00.00.00.00.0
Cavan General Hospital 15.015.415.810.110.610.711.710.910.211.010.310.6
Children's University Hospital Temple Street 9.35.47.66.13.53.92.93.04.54.04.34.7
tresesco
MVP
MVP

So you are using a pivot table. To achieve the same, a bit of script work would be required. try to post your sample app with sample data as INLINE. That would be fastest way to be helped.