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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
IgorGol
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
mfarsln
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
mfarsln
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'))".

 

IgorGol
Contributor III
Contributor III
Author

Thanks,

A lot