Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
gauthamchilled
Creator

Makedate not working

Anyone help attached excel source and qlikview file, Makedate function is not working.

1 Solution

Accepted Solutions
sunny_talwar

Caught it, Try this:

Test:

LOAD Date(Floor(MonthEnd(Makedate(Year, Month(Date#(Month, 'MMM')), 1)))) as Date1,

  Tarrif,

    Ratio,

    Month,

    Year

FROM

[TestData.xlsx]

(ooxml, embedded labels, table is Sheet1);


Floor will do the magic:


Capture.PNG

View solution in original post

6 Replies
sunny_talwar

Try this:

Test:

LOAD Makedate(Year, Month(Date#(Month, 'MMM')), 1) as Date1,

  Tarrif,

     Ratio,

     Month,

     Year

FROM

[TestData.xlsx]

(ooxml, embedded labels, table is Sheet1);


Capture.PNG

gauthamchilled
Creator
Author

Thanks sunny for the quick answer. I want the date to show monthend dates, so I tried converting to Monthend(Makedate(Year, Month(Date#(Month, 'MMM')), 1)) as Date1, when I checked that listbox of the date field it showing the date as 42095(when I changed date to number in listbox properties) equivalent of this number is april 2015 and not mar 2015. but my current selection is mar 2015. Do you have any idea?

sunny_talwar

Using the MonthEnd function, I am seeing this:

Capture.PNG

I also see 42095 when it is converted to number, but I am really not sure why it is doing that. Have you tried checking out the other numbers as well?

gauthamchilled
Creator
Author

I am also seeing that, my question is why if I convert this to number it is not showing equivalent date in excel?

sunny_talwar

Caught it, Try this:

Test:

LOAD Date(Floor(MonthEnd(Makedate(Year, Month(Date#(Month, 'MMM')), 1)))) as Date1,

  Tarrif,

    Ratio,

    Month,

    Year

FROM

[TestData.xlsx]

(ooxml, embedded labels, table is Sheet1);


Floor will do the magic:


Capture.PNG

jagan
Luminary Alumni

Hi Gautham,

MonthEnd() for this date will return 42094.999999988, which is equal to March 31, 11:59:59 PM, so when displaying as number it is rounding off to 42095, if you display this value in List box as Fixed to 9 decimals then you can see 42094.999999988. 

DateFormat.png

Hope this helps you.

Regards,

Jagan.