Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can someone help me with this formatting please?

Morning all,

A date field has changed formats in between one of my IT loads, I need to change the date back to how it was within the script. Can someone help me with the following please?

InputDateOriginal  2015-01

InputDateChanged 05/01/2015

I'm getting myself in a bit of a tizz with the syntax and I can't seem to get it right!

Any help is appreciated.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

=num(month(InputDateChanged))

View solution in original post

8 Replies
Anonymous
Not applicable
Author

use date(InputDateChanged,'YYYY-MM')

Anonymous
Not applicable
Author

you can again change it:

=date(YourFieldDate,'YYYY-MM')

Not applicable
Author

I've done that and it seems to work, I then need to split the month so I end up with a single number for the month.

e.g. 2015-01 would have a measure month of 1

That's the bit I'm struggling with, trying to get a single integer for the month.

miguelbraga
Partner - Specialist III
Partner - Specialist III

Hey Samuel,

Try this in the script:

Date(Date#([InputDateChanged], 'DD/MM/YYYY'), 'YYYY-MM') as InputDateOriginal

Regards,

MB

Anonymous
Not applicable
Author

=num(month(InputDateChanged))

miguelbraga
Partner - Specialist III
Partner - Specialist III

punitpopli
Specialist
Specialist

Hi FLsamvile18‌,

try this :

mid(Date(Date#([InputDateChanged], 'DD/MM/YYYY'), 'YYYY-MM'),6,7)

or you can use subfield as well.

Thanks,

Punit

Not applicable
Author

Thanks everyone for your help and answers, don't know how I didn't get that...I was trying to be too complex!