Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Mahamed_Qlik
Specialist
Specialist

Max to Year issue

I have only Year filed from source data.

YEAR

2019

2020

2021

 

I think it was in text format so I changed it to date format in the script first as

Date(Date#( YEAR, 'YYYY'),'YYYY')  AS YEAR

so when i take its max (YEAR), I not able to get it.

 

Can anybody help here?

7 Replies
stevejoyce
Specialist II
Specialist II

1st - You can see what format the field is in the data model viewer.  

2nd - I think of year to be stored as an integer, not a date.  So i would do num#(YEAR) as Year.  That will convert strings to number that can be.  Please see if this solves your issue.

Mahamed_Qlik
Specialist
Specialist
Author

Hey Steve,

 

Thanks for response. I tried the same. 
It is getting converted to numeric but I am still not getting its max.

 

mahamedfaijan_0-1628532016679.png

 

stevejoyce
Specialist II
Specialist II

Can you show me more of your issue?  Not sure why max(Year) wouldn't work on that field.

Mahamed_Qlik
Specialist
Specialist
Author

This is the only issue.

FYI

I am pulling YEAR directly from excel.

stevejoyce
Specialist II
Specialist II

I understand this is the only issue.  "Show me more of your issue" =  is it load script calculation -> please share load script.  Is it front-end calculation -> please share expression.  Can you attach your excel data file that you are having the issue with.

Mahamed_Qlik
Specialist
Specialist
Author

I will be ok if we handle it either way....but I tried both backend as well as frontend

stevejoyce
Specialist II
Specialist II

ok.  well this is a pretty simple calculation.  so without the excel source and either load script calculation or front-end calculation sorry but i can't help anymore.  maybe someone else will jump in if you don't want to give more details.