Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Trim a part of field and transform to date

Hi,

 

I have one columns with this kind of rows :

1. January-Planning

2. January-Actual

3. February-Planning

4. February-Actual

How would you:

1. Separate the word before '-' Delimiter  (January for example)

2. The word from 1 (January) how would you transform to date? so qlik will now it is Month and not a Text

 

Thanks!

1 Solution

Accepted Solutions
Highlighted
Creator II
Creator II

Hi,

For the first requirement;

 

mid(MonthField,1,index(MonthField,'-')-1)

 

Second one;

 

MakeDate(2020, Month(Date#(mid(MonthField,1,index(MonthField,'-')-1),'MMMM')),01 )

 

Oh you just wanted it as month, not date. So you can just use "Month(Date#(mid(MonthField,1,index(MonthField,'-')-1),'MMMM'))".

 

View solution in original post

2 Replies
Highlighted
Creator II
Creator II

Hi,

For the first requirement;

 

mid(MonthField,1,index(MonthField,'-')-1)

 

Second one;

 

MakeDate(2020, Month(Date#(mid(MonthField,1,index(MonthField,'-')-1),'MMMM')),01 )

 

Oh you just wanted it as month, not date. So you can just use "Month(Date#(mid(MonthField,1,index(MonthField,'-')-1),'MMMM'))".

 

View solution in original post

Highlighted
Contributor III
Contributor III

Thanks,

A lot