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: 
Not applicable

Count of days in timeframe

I have a line chart with dimensions for Person and a date cyclic group which shows the day, week, month, etc.  I want to create an expression to calculate the number of days within the timeframe.  So if I select week for the date cyclic group, the number of days should be 7.  Started with COUNTNUMERIC ({1} Days).  This works and counts the days where the person has a value/data.  However, I want to count all days regardless if the Person has a value/data for that day.

6 Replies
Not applicable
Author

I'm not sure I understand your question.  Could you post a sample, picture or a little more detail?

Are you trying to count the number of days in a specific month?

     -ie Feb would be 28 except every fourth year it would be 29

Or are you trying to keep it generic a day=1, week =7, month =30 etc...

I would love to help but I am not sure I understand.

Not applicable
Author

are you trying to achieve the equivalent of DATEDIFF() in SQL context?

Not applicable
Author

Count the number of days in the specific month, so 28, 29, 30 or 31.

wallinpeter
Contributor III
Contributor III

Tough to answer with knowing how you modeled your data.

Have you tried.....

COUNTNUMERIC (TOTAL Days)

or

COUNTNUMERIC (TOTAL DISTINCT Days)

Not applicable
Author

The file is likely too big to load. When I use the total or total distinct it adds the days across all the people. so 30 *10 people , it would say 300 days

wallinpeter
Contributor III
Contributor III

try....

COUNTNUMERIC (TOTAL<Person> Days)