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

Need help on working days calculation by Summary level!

Hi All,

Good day!

My Claendar QVD contains the following info.

calendar QVD:

LOAD

[Date Key],

[Calendar Name],

[Fiscal Year],

[Fiscal Period],

[Working Day Divisor]

FROM [$(vQvdFile)](qvd);

but i wanted calculate the below SQL logic using the above QVD info. could you please help me out on the same please.

set   @iDate = tableX(0) /*value 0 gives today, -1 yesterday etc*/

;with Tmpwd as (

select

Country,

Period,

SUM(workingday) as TotalWrkDays,

sum(case

when [DATE] < @iDate then workingday

else 0

end) MTD_Days

from tbl_workingdays_country

group by

Country,

Period     

)

, Cal as (

select a.Country, a.[Date], a.[Period], Tmpwd.TotalWrkDays as TotalPeriodWorkingDays, Tmpwd.MTD_Days as MTD_WorkingDays_Period

from

  tbl_workingdays_country a

inner join Tmpwd on

a.country = Tmpwd.country and

a.period = Tmpwd.period

)



many thanks in advance.


Sree

1 Reply
swuehl
MVP
MVP

Please don't post multiple times the same request, it makes it hard to follow a discussion.

I've posted an answer to

Need help on Working days Calculation!