Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to create a start date and end date range

Hi

I have one date field  name as WEEKLYDATE.

I need to create start date and end date by using WEEKLYDATE.

I will get data every week in M/D/YYYY format

When I select start date and end date user want to see last 52 weeks data only .

Thanks in Advance

Regards

Niranjan

7 Replies
sunny_talwar

You want this on the front end? Would you be able to provide a sample to look at?

Not applicable
Author

Yes I want this front end..

I created two calendar objects Start date and End date..

But I am not getting dates

sunny_talwar

Would you be able to share a sample?

Mark_Little
Luminary
Luminary

Hi,

I would take a look at the articles on Master calendars, then you can start building from there.

But Like Sunny has suggested if you could share some more information on exactly what you want and some examples it would help guide you better,

Mark

Not applicable
Author

Hi Sunny,

I am getting date format is

I created strat date and end date  the date format is coming like

The dates are not coming into start date and end date.

I created two variables vStartDate and vEndDate and wrote =Min(WEEKLYDATE) and =Max(WEEKLYDATE)

My requirement is user can select start date and end date and by default it will show past 52 weeks data.

Do I need to change any in SET Analysis.

SET TimeFormat='h:mm:ss TT';
SET DateFormat='MM/DD/YYYY';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

Pls help.

sunny_talwar

To me it looks like that you are date are not read as dates. Can you try a list box expression: Num(WEEKLYDATE) and see if you see the dates changing into numbers or not? If they don't then probably your WEEKLYDATE is a text field where you won't be able find Max and Min.

You can fix this in the script like this:

LOAD Date(Floor(Date#(WEEKLYDATE, 'MM-DD-YYYY hh:mm:ss'))) as WEEKLYDATE

and then move from there. Also read here for more information related to dates

Get the Dates Right

Why don’t my dates work?

Not applicable
Author

Hi Boppella,

1. Front end You use Calendar range Like From --> To

Edit Script -- >

SET @DateStart = CAST('01/' + @Parameter AS DATETIME)
SET @DateEnd = DATEADD(DD, -1, DATEADD(MM, 1, @DateStart))

Or else:

Write in sql like start date and end date ..

Thanks

Nandu.