Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
kevbrown
Creator II
Creator II

Adding Date to set analysis

I'm looking at some set analysis and have the following -

=Count( { < [Specialty Code] = { '700' } > } [Bed Days.Occupied])

I want to add a date criteria to is so it only looks at yesterdays date. My date field is called "Date"

1 Solution

Accepted Solutions
kevbrown
Creator II
Creator II
Author

Think I've done it

=Sum( { <[Specialty Code] = { '700' }, [Date] = {"$(=Date(Today() -1))"}, InfoCalDay, InfoCalMonth, InfoCalYear>} [Available Beds.Beds Available])-

Count( { <[Specialty Code] = { '700' }, [Date] = {"$(=Date(Today() -1))"}, InfoCalDay, InfoCalMonth, InfoCalYear>} [Bed Days.Occupied])

View solution in original post

13 Replies
sunny_talwar

May be like this:

=Count({<[Specialty Code] = { '700' }, Date = {"$(=Date(Today() -1, 'DateFieldFormatHere'))"}>} [Bed Days.Occupied])

kevbrown
Creator II
Creator II
Author

That works (however I don't need the datefieldformat as I'm just looking for a number in a text box. Problem is now that when i make a date selection the number changes, I want it to be today no matter what the user selects

Anonymous
Not applicable

Hi

based on sunny's solution and your query: ............I want it to be today no matter what.................

try below ?!!

=Count(  { 1 <[Specialty Code] = { '700' }, Date = {"$(=Date(Today() -1, 'DateFieldFormatHere'))"}>} [Bed Days.Occupied])

sunny_talwar

I don't think this should happen, can you share a sample where this is happening for you?

sunny_talwar

I don't think 1 should bee needed

kevbrown
Creator II
Creator II
Author

It's the text box, Occupied Bed Days

sunny_talwar

Are you making selection in Date or are you making a selection in Day, Month, Year fields??? If Day, Month and Years are the fields you are making selections in, then you probably need this:

=Count({<[Specialty Code] = { '700' }, [Date] = {"$(=Date(Today() -1))"}, InfoCalDay, InfoCalMonth, InfoCalYear>} [Bed Days.Occupied])

kevbrown
Creator II
Creator II
Author

Perfect, thank you

kevbrown
Creator II
Creator II
Author

How about the empty beds box?