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: 
lucasx15
Contributor III
Contributor III

Using Monthstart and Monthend for hours available

Hello everybody!

I'm new to Qlikview and I have a question about how to calculate Available Hours for a service. In this case, I need to know the total number of hours available on the day of a service. I developed this expression:
NR_EQP*24*MonthStart(MAX(DT_BUY_FIRSTDAY))- MONTHEND(MIN(DT_BUY)) AS HRS_AVAILABLE

Where, NR_EQP is my equipment. 24 is the total hours and MonthStart(DT_BUY_FIRSTDAY) is the first day of the month. And, Monthend(DT_BUY) the last day of the month. But the result is incorrect.

Labels (1)
1 Reply
Or
MVP
MVP

It's quite hard to guess what your problem might be when you don't provide any sample data and you don't explain what the problem is, only that "the result is incorrect". What is the result? What would the expected result be given a set of sample data? Are you getting the expected value when you use each part of the expression separately or are one or more of them not the expected value? Also, are you sure you're correct in subtracting the first day of the month in the first half from the last day of the month in the second part? Wouldn't it be the other way around?