Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Announcement: Certain actions are currently causing a Page Not Found error. This is a known issue and we are working with the platform vendor to investigate and resolve it.
Highlighted
Partner
Partner

date(Floor(MyDate),'MMM')

Hi!

I have a timestamp and have managed to make it into only YYYY-MM-DD by using date-floor-function. It works perfectly!

When only using date-function, without floor, duplicates of the date appear, see the attached picture. Therefore I am using the floor-function aswell.

datInkomDatum,
date(Floor(datInkomDatum)) as datInkomDAG,

date(datInkomDatum) as datInkomTEST,

However, when I use the same method (date-floor-function) to get the months out, it shows duplicates of the months.

date(Floor(datInkomDatum),'MMM') as datInkomMÅN,

How do I get the months out like I did with the dates for datInkomDAG?

Thank you!

Labels (4)
1 Solution

Accepted Solutions
MVP
MVP

Re: date(Floor(MyDate),'MMM')

May be just Month()

Month(datInkomDatum) as datInkomMÅN
4 Replies
wandererroch
New Contributor III

Re: date(Floor(MyDate),'MMM')

Easiest way is to wrap the date in monthstart(). This will give you a consistent point of reference. Qlikview likes to hold on to the actual date in the background even when you ask only for the month portion.
amrinder
Contributor

Re: date(Floor(MyDate),'MMM')

Hi,

When you are using only Date function,May be due to different time available on same date it is treating it like different values. Try using Distinct like below:

 

Load Distinct

*,

date(Floor(datInkomDAG ),'MMM') as datInkomMÅN,

Load

*,

date(Floor(datInkomDatum)) as datInkomDAG 

from A.xlsx;

 

Let me know if it worked.

MVP
MVP

Re: date(Floor(MyDate),'MMM')

May be just Month()

Month(datInkomDatum) as datInkomMÅN
Partner
Partner

Re: date(Floor(MyDate),'MMM')

Thank you Tresesco!! Embarrassingly simple ^^