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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Hania
Creator
Creator

Fiscal Date Formate

I am facing issue in formatting can you guys help me,

I want to format fiscal year  ,

Fiscal Year in format as :  2011-2012

required Format : 2011-12

Looking forward to your response.

 

 

Labels (2)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master II
Partner - Master II

Slight addition to @Mark_Little 's suggestion.

DATE#(SUBFIELD([Fiscal Year], '-',1)&'-'&RIGHT(SUBFIELD([Fiscal Year], '-',2),2),'YYYY-YY') AS [Fiscal Year]

View solution in original post

3 Replies
Mark_Little
Luminary
Luminary

In script use the following

SUBFIELD('[Fiscal Year]', '-',1)&'-'&RIGHT(SUBFIELD('[Fiscal Year]', '-',2),2) AS  [Fiscal Year]

Hania
Creator
Creator
Author

Thank you for your reply it gives me result but with data type of string and i want result with numeric data type.

BrunPierre
Partner - Master II
Partner - Master II

Slight addition to @Mark_Little 's suggestion.

DATE#(SUBFIELD([Fiscal Year], '-',1)&'-'&RIGHT(SUBFIELD([Fiscal Year], '-',2),2),'YYYY-YY') AS [Fiscal Year]