Hi, I find qlikview can be very precious when it comes to dealing with dates, you may want to try something like :
changing $(=Only(DAY)-364) to date($(=Only(DAY)-364) ,'DD/MM/YYYY')
or maybe : '$(=date(only(DAY)-364.'DD/MM/YYYY'))'
it is dificult to say what you should do without knowing the exact format of your DAY field.