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: 
Anonymous
Not applicable

Split year and month

Capture 1.PNG  I have attache my file.I need to spilt as year and month,also month should be in text format.please clear my dbts

Labels (1)
1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

You can try this.

Load Period,

        Year(Makedate(Left(Period,4),Right(Period,2))) as Year,

        Month(Makedate(Left(Period,4),Right(Period,2))) as Month

From Xyz;

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

6 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

You can try this.

Load Period,

        Year(Makedate(Left(Period,4),Right(Period,2))) as Year,

        Month(Makedate(Left(Period,4),Right(Period,2))) as Month

From Xyz;

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Anil_Babu_Samineni

Try This too

Table1:

Load Period From Source;

Left Join(Table1)

Load Period,

           Left(Period,4) as Year,

           Right(Period,2) as Month

Resident Table1;


Or


Load Period,

          Year(Period,'YYYY') as Year,

           Month(Period,'Mmm') as Month

From source ;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
antoniotiman
Master III
Master III

Hi,

LOAD *,

Year(Date#(Period,'YYYYMM')) as Year,

Month(Date#(Period,'YYYYMM')) as Month

From Table;

Month is Dual Field (Text and Number)

Regards,

Antonio

Anonymous
Not applicable
Author

Thanks..Its worked.

Anonymous
Not applicable
Author

Year(Date#(Period,'YYYYMM')) as Year,

Month(Date#(Period,'YYYYMM')) as Month

In this,What is the meaning of '#'.My view is fetch the value.am i  right?

oknotsen
Master III
Master III

If your question is now answered, please flag the Correct Answer (via the big "Correct Answer" button near every post) and Helpful Answers (found under the Actions menu under every post).

If not, please make clear what part of this topic you still need help with .

May you live in interesting times!