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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Chanty4u
MVP
MVP

RE:subfield

hi

how i vil get year,month by using subfield function

i wil get ans lik 2015-06 0r 2015-jun

can any one help on this

Suresh

Labels (1)
14 Replies
tyagishaila
Specialist
Specialist

Hi,

You can also get it by using left() and right().

Chanty4u
MVP
MVP
Author

tanq all.

Suresh Chanty

sasiparupudi1
Master III
Master III

Table1:

LOAD

if (len(Subfield(Date,'-',2))>2,Month(Date#(Date, 'YYYY-MMM')),Month(Date#(Date, 'YYYY-MM'))) as Month,

if (len(Subfield(Date,'-',2))>2,Year(Date#(Date, 'YYYY-MMM')),Year(Date#(Date, 'YYYY-MM'))) as Year

Inline

[

Date

2002-01

2003-Apr

2014-02

2015-Jun

];

qlikviewwizard
Master II
Master II

Hi sureshqv ,

Please close the thread by selecting Correct Answer.

tyagishaila
Specialist
Specialist

left( [fieldName], 4) as Year

right( [fieldName],2) as Month