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

GetFieldSelections Date Format

Hi everyone,

I'm trying to format a GetFieldSelections(Month) to a number (i.e. Jan = 1, Feb = 2, etc.).

When I try date#(GetFieldSelections(Month), 'MMM') I get the month, great, this is what I want... As soon as I try to do num(date#(GetFieldSelections(Month), 'MMM')) it gives me a number like -363 when I select January.

What am I doing wrong?

Thanks!

Joe

1 Solution

Accepted Solutions
swuehl
MVP
MVP

try

=Num(Month(date#(GetFieldSelections(Month),'MMM')))

View solution in original post

3 Replies
swuehl
MVP
MVP

try

=Num(Month(date#(GetFieldSelections(Month),'MMM')))

Not applicable
Author

You're the man!


Thank you!

Joe

Anonymous
Not applicable
Author

Hi Joe,

You could try something like this:

=Num(Date#(GetFieldSelections(Month)&'-'&Year(today()), 'MMM-YYYY'))

It seems that when you convert to day using only the month, Qlik doesn't have enough information and set current data as 1st of month and year something like 1899 (Try to apply Date for to your current expression).

Hope it helps.

-- Karla