Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
thabo2g5
Contributor III
Contributor III

how to keep the value constant

hi everyone

i'm working on a project  i need to find availability of application and each and every system work in different times so i manage to flag working days ,Saturday and Sunday for the applications. the problem i'm having is when i click on in the application i need it to consider the whole month not that day.

e.g  Jan 2017  have  22 working days  , 4 Saturday , 5 Sunday   if i click on lets say  facebook (as application for example purpose) i can get total min for the whole months total min = workingdays(whole month) * minutes that the application is been up.

  the problem i'm having is that that qlikview look at an application at that particular day not the whole month.

how can i keep the working days , saturday and sunday days constant for each and every month ?

7 Replies
MK_QSL
MVP
MVP

Provide the expression here which you are using for finding Total Min

thabo2g5
Contributor III
Contributor III
Author

calendar that flags if days are workingdays ,sat or sunday

MasterCalendar:

LOAD *,

      If(WeekDay <5, 1,0) as IsWorkingDay,

     If(WeekDay = 5, 1,0) as IsSaturday,

     If(WeekDay = 6,1,0) as IsSunday;

     //if(WeekDay = 24, as IS=s24hours;

LOAD

  num(TempDate) AS start_date,

  Year(TempDate) AS Year,

  Month(TempDate) AS Month,

  Date(Monthstart(TempDate), 'D-MMM-YY') as YearMonth,

  Weekday(TempDate) AS WeekDay,

  inyeartodate(TempDate, maxdate, 0) * -1 AS CurYTDFlag,

  inyeartodate(TempDate, maxdate, -1) * -1 AS LastYTDFlag

;

//=== Generate a temp table of dates ===

LOAD

  date(mindate + IterNo()) AS TempDate

  ,maxdate // Used in InYearToDate() above, but not kept

WHILE mindate + IterNo() <= maxdate

;

//=== Get min/max dates from fact table ===/

LOAD

  min(start_date)-1 as mindate,

  max(start_date) as maxdate

RESIDENT [Snow Data]

;

total min expressions

=sum(IsSaturday*Min_Sat)+sum(IsSunday*Min_Sun)+sum(IsWorkingDay*Min_WeekDay)

MK_QSL
MVP
MVP

Try

=sum({1}IsSaturday*Min_Sat)+sum({1}IsSunday*Min_Sun)+sum({1}IsWorkingDay*Min_WeekDay)

thabo2g5
Contributor III
Contributor III
Author

thank you for the effort

i would like it to stay constant for every month

e.g jan has 22 working days , 4 sat and 5 sunday

  feb have 20 working days , 4 sat and 4 sunday

want qlikview to give me this numbers , so that i can get total min

e.g  for january 2017

(22*660(minutes)) + (4*430(min)) + (5*160(min))

for jFeb 2017

(20*660(minutes)) + (4*430(min)) + (4*160(min))

MK_QSL
MVP
MVP

Where are you using this?

What are the dimensions ?

thabo2g5
Contributor III
Contributor III
Author

dimensions : applications & year

expression :(20*660(minutes)) + (4*430(min)) + (4*160(min)) (total minutes for the month)

MK_QSL
MVP
MVP

Provide sample app here to work.. or sample data. Unable to understand your expression now.

Why are you using 20 ,4 ,4 in expression as static?