Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Counting Days

When I select a Week in my document, the number of days in that week are highlighted only  if there is data for those days.  For example, a week has seven days but if my selection only contains data for 6 days, the count is 6.  I want to be able to count the number of calendar days in a selection, regardless of presence of data.  So, if I select a month I want to count 30, 31, or 28 days.  Even if there are days missing data.

Can I do that?

Brian Summ

1 Solution

Accepted Solutions
Not applicable

Re: Counting Days

Haven’t tried it yet. Thanks though.

View solution in original post

5 Replies
sebastiandperei
Valued Contributor

Re: Counting Days

Hi Brian.

It depends on the schema you have created. Do you have a Calendar Table?

If you have it, you could count (distinct Date_Field)

If you don't have it, try with

max(Date_Field)-min(Date_Field)

Date_Field must be in date format, not timestamp.

Not applicable

Re: Counting Days

Hi Sebastian,

Thanks for the help. I have tried the count function. Trouble is it only counts selected days if there is data. I want to count all selected days, regardless of presence of data.

Regards,

Brian

Partner
Partner

Re: Counting Days

You must create a Calendar table and use Set analysis at MIn and Max function. Like that: max({1<week=,week={$(#=only(week))}>} date)

Highlighted
sebastiandperei
Valued Contributor

Re: Counting Days

Did you have tried the second suggest i sent?

Please, read all!

max(Date_Field)-min(Date_Field)

Not applicable

Re: Counting Days

Haven’t tried it yet. Thanks though.

View solution in original post