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

Announcements
Mastering Change Data Capture: Read Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to display start date as start DATE OF month?

Hi team ,

I have a date column and fiscal year column like below

Year and Month

2011/01 (Jan)

2011/02 (Feb)

2012/03(Mar)

Now i want to display like below

2011-1-1

2012-2-1

2012-3-1

thanks

7 Replies
Not applicable
Author

=Date(Date#([Year and Month], 'YYYY/MM'), 'YYYY-M-D')

Cheers

Not applicable
Author

Hi, Martin

I TRIED BUT ITS NOT WORKING,

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this.

TestData:

LOAD if(Len(Date) = 13, Date(Date#(Date,'YYYY/DD (MMM)')),Date(Date#(Date,'YYYY/DD(MMM)'))) as New_Date,Date INLINE [
Date
2011/01 (Jan)
2011/02 (Feb)
2012/03(Mar)
];

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi,

its not working

Date

2011-02-23

2011-02-25

2011-03-01

2011-05-30

Output like below

2011-02-01

2011-02-01

2011-03-01

2011-05-01

please help

thanlks

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     But in the example you gave, dates are not given.

    

2011/01 (Jan)

2011/02 (Feb)

2012/03(Mar)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
MayilVahanan

HI

Try like this

=MonthStart(Date(Date#('2011-02','YYYY-MM'),'YYYY/MM'))

or

=MonthStart(Date(Date#('2011-02-23','YYYY-MM-DD'),'YYYY/MM/DD'))

its for text box.

in script, simply use monthstart() function for ur date, if its in correct date format,other wise use date#() function.

hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

HI

TRY THIS

=date(date#('2011-02-23','YYYY-MM-DD'),'YYYY-MM-01')

or


=date(date#(datefield,'YYYY-MM-DD'),'YYYY-MM-01')

hope this helps you