Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Talk to Experts, a LIVE Q&A Webinar. Bring your Qlik Sense Business questions on Aug. 4th. Register
Showing results for 
Search instead for 
Did you mean: 
Creator II
Creator II

Duration of a full Month in Minutes

Hi All,

I want to show the duration of a minutes of current Months. Lets say today is 12th Nov 2016. So I want to calculate 30*24*60 = 43200.

I am able to do this. using this function:

Script Level:

Date(MonthStart(date#([sys_created_on],'YYYY-MM-DD hh:mm:ss')), 'YYYY-MMM')  as [Outage_Sys_Month_Year],

Date(MonthStart(date#([sys_created_on],'YYYY-MM-DD hh:mm:ss')), 'YYYY-MM-DD hh:mm:ss')  as [Outage_Sys_MonthStartDate],

Date(MonthEnd(date#([sys_created_on],'YYYY-MM-DD hh:mm:ss')), 'YYYY-MM-DD hh:mm:ss')  as [Outage_Sys_MonthEndDate],

KPI Level:

(Outage_Sys_MonthEndDate - Outage_Sys_MonthStartDate)*24*60

But I want to make this fixed for current Month. It should not change with Outage_Sys_Month_Year selection.

I tried to implement using variable. But not sure how to apply that.

Please help.



2 Replies

Re: Duration of a full Month in Minutes

Assuming KPI level means in UI

Try this..

=(max({<Outage_Sys_Month_Year=>}Outage_Sys_MonthEndDate) - max({<Outage_Sys_Month_Year>}Outage_Sys_MonthStartDate))*24*60


Re: Duration of a full Month in Minutes

Hi Mohammad

As your expression meant to show always no of minutes from Month Start till now why  not to use this expressions:


or if you like to format it nicely i would use interval function like this:

=Interval(Now()-MonthStart(Now()),'ddd hh:mm:ss') which will result in somtehing like this: 013 10:55:53

=Interval(Now()-MonthStart(Now()),'mmmmm:ss') which will result in somtehing like this: 19376:53

Those expressions can be implemented in script, variable calculation or expression field.

Let me know if it helps



cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.