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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
abhaysingh
Specialist II
Specialist II

Calendar Logic

Hi Guys,

Pls find the attached calendar qvd, in this i have continuous dates in it, what i want is right now i am @ 27 May 16,

I want to calculate no of days of current month till Date.

As per todays days 27 May 16, No of Days should be 27

pls suggest ho i can handle the continuous dates ,, i m getting 31

7 Replies
sunny_talwar

Why do you need a calendar to do that. Have you tried this -> Day(Today())

abhaysingh
Specialist II
Specialist II
Author

Hi,

bcoz if i will select last month than it will not give me total no of days of that month.

any suggestion as per calendar dates?

Kushal_Chawda

try

Day(Date) as Days

or

floor(Date)-floor(monthstart(Date)) as Days

sunny_talwar

I guess try what Kush mentioned

Day(Date)

and on the front end just use Max(Day) based on your selection of Month it should change.

abhaysingh
Specialist II
Specialist II
Author

But i am not getting 27 days..getting 30 in may

sunny_talwar

May be try like this:

If(Today() >= Date, Day(Date), Day(Today()) as ModifiedDay

Not applicable

HI,

Check the attached


It may work


temp:

LOAD [Calendar Date],

     link_Date,

     Days,

     Weeks,

     WeekDays,

     [Week Start],

     [Week End],

     [Calendar Year],

     [Calendar Month],

     [Fiscal Month Num],

     [Calendar Month Num],

     [Fiscal Quarter],

     [Fiscal Year],

     [FY Year Name],

     [Month Start],

     [Month End],

     [Quarter Start],

     [Quarter End],

     [Fiscal YYYYMM],

     [Calendar Month Year],

     [Fiscal Month]

FROM

[..\Downloads\Stage2_Calendar.qvd]

(qvd);

twef:

LOAD count(if(MonthName([Calendar Date])=MonthName(Today()),[Calendar Date])) as countdays

Resident temp where [Calendar Date]<=Today();