Some problems with the count function

Hi Guys,
I am trying to return following:
2009 GUESTS NIGHTS between 1 and 5 = 80 guests
2009 GIESTS NIGHTS between 5 and 10 = 100 guest
Whe I use the combine with a similar report option (union), I issue the following query:
SELECT saw_0 saw_0, saw_1 saw_1, saw_2 saw_2, saw_3 saw_3 FROM ((SELECT Resort.Resort saw_0, Time."Year" saw_1, "Non Revenue Facts".Nights saw_2, count(Guests."Guest Name") saw_3 FROM GUEST WHERE "Non Revenue Facts".Nights BETWEEN 1 AND 5 GROUP BY saw_1, saw_2, saw_0) UNION (SELECT Resort.Resort saw_0, Time."Year" saw_1, "Non Revenue Facts".Nights saw_2, count(Guests."Guest Name") saw_3 FROM GUEST WHERE "Non Revenue Facts".Nights BETWEEN 1 AND 5)) t1 GROUP BY saw_1, saw_2, saw_0 , saw_3 ORDER BY saw_0
The query return just the results for nights between 1 and 5.
I need two columns showing the count of the guests with nights till 5 and one other column showing the count of the guests with nights from 5 to 10.
Any help would be really appreciated.
Regards
Giuliano

Sorry I did not get this.
I should still use the union statement and than build the below function in the nights fields?
What I am trying to achieve is simply how many guests do i have with at least 1 night and max 5 nights
and how many guests i have with at least 5 nights and a max of 10 nights.
I should have 2 columns:
1 label Nights between 1 and 5
2 label Nights beween 5 and 10
the count(guests) column should than show how many guests in the first range and how many in the second.
Regards
G.

Similar Messages

  • I 've a problem with the print function of Itunes

    helo , i 've a problem with the print function of Itunes.
    When i'm trying to create a pdf file of my entire library, i've got a partial file of it.
    instead of the entire library (37000 songs - 209GByte) the pdf file contains only 18000 songs (1GB - pdf file).
    Is there any problem with the pdf creation in Itunes ?
    best regards
    Marco
    i mac 20"   Mac OS X (10.4.9)  

    Please read https://forums.adobe.com/thread/1499014
    -try some steps such as changing browsers and turning off your firewall
    -also flush your browser cache so you are starting with a fresh browser
    http://myleniumerrors.com/installation-and-licensing-problems/creative-cloud-error-codes-w ip/
    http://helpx.adobe.com/creative-cloud/kb/failed-install-creative-cloud-desktop.html
    or
    A chat session where an agent may remotely look inside your computer may help
    Creative Cloud chat support (all Creative Cloud customer service issues)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html

  • I just upgraded my iMac to Lion, and a few seconds ago, I upgraded the iWork package and now I'm having some problems with the new version of Pages (4.1) When I try to change something in a document, a message says "the program is not responding"

    I just upgraded my iMac to Lion, and a few seconds ago, I upgraded the iWork package and now I'm having some problems with the new version of Pages (4.1) When I try to change something in a document, a message says "the program is not responding", so I have to force it to close. By the way, the SAVE botton stays the same even I change erverything in my document. Please, a have a work to finish, **** me. What I can do abou it?

    I just upgraded my iMac to Lion, and a few seconds ago, I upgraded the iWork package and now I'm having some problems with the new version of Pages (4.1) When I try to change something in a document, a message says "the program is not responding", so I have to force it to close. By the way, the SAVE botton stays the same even I change erverything in my document. Please, a have a work to finish, **** me. What I can do abou it?

  • I created one apple I'd when I started using the iPad.  After some days, I had to create a new apple I'd as there was some problem with the first one. Now at some places still my old apple I'd is appearing.  Pls adv how I change this to my new apple Id.

    I created one apple I'd when I started using the iPad.  After some days, I had to create a new apple id
    as there was some problem with the first one. Now at some places still my old apple Id is appearing.  Pls adv how I change this to my new apple Id.

    Anything you downloaded with the first Apple Id will forever be tied to it, and will always require it to update.
    The question here is, why did you think you needed to create a new Apple ID? What was the problem with the first one?
    To get rid of th old one, you'll need to delete everything you downloaded with it, and then sign out of the ID in several places around the iPad. 
    Go to Settings->iTunes & App Stores->Apple ID->Sign out.
    Repeat the process, for Facetime, Messages, Mail and any other App you need to sign out of.

  • When downloading from a Sony minidisc video camera, the picture is downloading but without sound.  Previously, it had downloaded successfully both sound and picture.  I have subsequently upgraded to Lion X (10.7.4).  Is there some problem with the driver?

    When downloading from a Sony minidisc video camera, the picture is downloading but without sound.  Previously, it had downloaded successfully both sound and picture.  I have subsequently upgraded to Lion X (10.7.4).  Is there some problem with the upgrade which is affecting the transfer?  Is there a way of resolving this?

    When you have kernel panics, the pertinent information is in the panic report.
    These instructions must be carried out as an administrator. If you have only one user account, you are the administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad and start typing the name.
    In the Console window, select
              DIAGNOSTIC AND USAGE INFORMATION ▹ System Diagnostic Reports
    (not Diagnostic and Usage Messages) from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar.
    There is a disclosure triangle to the left of the list item. If the triangle is pointing to the right, click it so that it points down. You'll see a list of reports. A panic report has a name that begins with "Kernel" and ends in ".panic". Select the most recent one. The contents of the report will appear on the right. Use copy and paste to post the entire contents—the text, not a screenshot.
    If you don't see any reports listed, but you know there was a panic, you may have chosen Diagnostic and Usage Messages from the log list. Choose DIAGNOSTIC AND USAGE INFORMATION instead.
    In the interest of privacy, I suggest that, before posting, you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if it’s present (it may not be.)
    Please don’t post other kinds of diagnostic report.
    I know the report is long, maybe several hundred lines. Please post all of it anyway.

  • Can't find some strings with the Find function in LV2012

    Hi
    I got a problem with the "Find function" in LV2012.
    The Find function can't find the text "IniFile: WriteKeys" in the string constant in the innercase.
    Why is that?
    I have tried to plase a copy of the constant(se next picture)  and then it can only find the one marked with yellow!
    regards Bjarne

    Hi Anders.
    Thank you
    I have tried the things you suggested and my strings are exactly the same and it didn't work to put the outside-string(that could be found) inside the case.
    Here is the VI but be aware the broken arrow, because the sub VIs is not incorporated
    By the way, my name is Bjarne, not Bjarke
    Regards Bjarne
    Attachments:
    VASPMain.vi ‏674 KB

  • Problems sending mail: some problem with the outgoing mail server SMTP?

    I can't send e mails: some problem with the outgoing mail server SMTP?

    I had this same problem with both my imac and mac book pro using hotmail via mac mail with bt as my internet provider. Suddenly 4 months ago out of nowhere i could receive emails but could not send them. I scoured all the threads followed all the fixes none of them worked. However I just phoned apple support and fixed it in a matter of minutes. I am SO happy. This is what the technician advised me:
    Go to your apple icon and scroll down to system preferences. Then dependant on what machine you have it is different for my imac and mac book pro click on either air port/wifi then the advanced tab in the bottom right hand corner. Then click on the DNS tab. Hit the + sign on the left hand side and type in 8.8.8.8 then hit the + sign again on the left hand side it will create a new line underneathe and type 8.8.4.4 then hit okay on the bottom right and then hit apply, again on the bottom right. Then send a test email to check but it should be fixed.
    Had to share this. Its been driving me mad for months.

  • Problems with the CrossTable Function "Sort"

    Hello,
    I have a Problem with the "nice" crosstabfunction of the DesignStudio.
    When I create from a datasource the crosstab and enable the function for sorting it is only possible to sort the first column.
    The other columns get the sign into the Header for the sort function, too. But if I click on it, it won't work and sort nothing.
    I'm sure with the old Version of SAP Design-Studio (1.2) it has worked!
    Now we are using 1.4 and u can only sort the first column?????
    Do I anything wrong? I set only the value for the crosstab (Sorting enabled) on true.
    Thank you for help.
    Greets,
    André

    Hello again,
    The Application Looks like:
    Settings:
    Structure:
    I don't have any further JS Coding for this case implemented. I think that this would be not necessary because of the Settings of the crosstab or?
    Greets,
    André

  • I ave some problems with the right management for files in the movie folder

    There are saome files with toe records of everyone in the right. I can't delete or copy this files without  my Admin password. The folder movies where displayed without the triangel in the list option. I have copied all files an folders to an external drive. The Folder Movies have i delete ove my root account. Then I have all files copied zo the new folder who was created automatical when i locked in. Now the problem with the list view ist solved but the rights of the files are not solved. I can change the rights vor the everyone manually for each file. But for more than 1000 files this is not usable.

    drwx------+  18 onlymac  staff    612 24 Okt 12:52 .
    drwxr-xr-x+ 134 onlymac  staff   4556 24 Okt 12:44 ..
    -rw-r--r--@   1 onlymac  staff  43012 24 Okt 12:54 .DS_Store
    -rw-rw-rw-    1 onlymac  staff      0 18 Okt 13:33 .fcplock
    -rw-r--r--@   1 onlymac  staff     30 24 Okt 12:52 .fcpuser
    -rw-r--r--    1 onlymac  staff      0 18 Okt 11:53 .localized
    drwx---r-x@   4 onlymac  staff    136 18 Okt 12:18 Aiseesoft Studio
    drwx---r-x+   4 onlymac  staff    136  5 Jun  2010 DivX Movies
    drwx---r-x+   4 onlymac  staff    136  7 Jun 00:20 Eye-TV
    drwx---r-x@  12 onlymac  staff    408 22 Sep 23:43 Final Cut Events
    drwx---r-x+   9 onlymac  staff    306 24 Okt 10:06 Final Cut Projects
    drwx---r-x+   3 onlymac  staff    102 23 Okt 23:49 Handbrake
    drwx---r-x@   9 onlymac  staff    306 31 Jul  2010 Kamerafilme
    drwx---r-x+   3 onlymac  staff    102  6 Okt 14:19 MAC The Ripper
    drwx---r-x+  10 onlymac  staff    340 24 Okt 12:51 Motion Templates.localized
    drwx---r-x+   7 onlymac  staff    238  2 Feb  2011 iMovie Events.localized
    drwx---r-x+   8 onlymac  staff    272 21 Aug 01:18 iMovie Projects.localized
    drwx---r-x+   4 onlymac  staff    136 21 Apr  2011 iMovie-Kamera-Archive.localized

  • Some probleme with the MVR protocol

    Hi,
    In order to broadcast some video on different VLAN, I use the MVR protocol on switch 2950 and 3560. This solution works, but I have some problemes when the switch reboot or when I do some intervention on the port (unblock an err-disabled interface, make a "no shut" for example). In those case, I must reactivate the MVR. The multicast flow reaches the switch, but the users can't access to it. I must write this sequence in configuration mode :
    no mvr
    mvr
    When I write those instructions, everything works. This solution is OK if I have 1 switch, but not on an entire network. I don't understand why this protocol don't start correctly, like the others process.
    To be more specific, the IOS version for the 2950 is IOS (tm) C2950 Software (C2950-I6Q4L2-M), Version 12.1(22)EA9.

    A couple of things to check are
    1- make sure pim is enabled on all subnets/vlans that has a client wishing to receive the stream.
    2 - make sure that the ttl value on the application is high enough if it is crossing vlans.

  • Hi!!I have some problems with the synchronization of my system, and I don´t know how I can solve this!

    My system consists of differents vi´s.Some of them are used to read analogic inputs and digital inputs, using the serial port.
    The values that I read, go through differents vi to be proccesed, and at the end, these values are written in a file, all the values in the same file.
    My problems of synchronization are:
    1. I have one vi per input, and all of them use the same serial port. How can I synchronize them to avoid serial port conflicts? (using queues??) And how can I do, to get differents number of samples/sg with every vi? I have to introduce them in differents loops?
    2. The other problem is that, for example, I want to read 8 samples/ s but I only want
    to write two samples every second. How can I do to avoid stoping the data flow?
    Maybe, my problem is that I want to see the system like
    one block, and I am ignoring that, although all the system works like a block, every part works using a different "speed". I don´t know how tools can I use to combine two ideas, working like an only system( data dependence, some vis need the data of others vi to be able to work) and working getting differents numbers of samples/s.
    I have seen that there are synchronization vis. I am going to glance at them, maybe I find something interesting but I amsure that your help will be very useful?
    Thanks in advanced!!
    Graci

    I think you are pretty much on the right track with Queues. I have implemented a very similar system myself using queues. I have even different systems connected to the serial interface, but I can synchronise them all easily using the following method:
    1) Make a VI for opening the serial port and reading the data. The data (parsed to extract the numbers required) are then stored in an array (Shift register). If the pre-determined time delay is reached (say 5 seconds) the values are averaged and written to a Queue with a defined data type. Save the VI as a VI template.
    2) Make a VI which starts an instance of this template VI for every channel you require. You can use VI Server to set values on the new front panel before you set it's property to "running". Setting a timer value for all can help ensure that the X-Axis of your timing values (if you require) are synchronised. The clue here is to define and initiate a QUEUE per channel. (RS-232_1, RS-232_2 and so on). The QUEUE name needs to be passed to the VI Template before running so that each VI running in the background has an individual link to the main program.
    The second part of this VI simply uses an array of QUEUES, polling them one after another with a timeout of, say 5 ms. If data is found, append accordingly to an XY-Graph.
    I also add in some "Auto termination" in the VI template (MAx number of values allowed in the QUEUE for example) to allow for the background processes to find out if the front-VI is still running or not. There are many different ways to do this, shoose the best for your application.
    With this approach, it's not even important what instrument is connected as long as data is written in a specified format into a known QUEUE. I have also developed systems where I can transparently (almost) drop in VI Templates for instruments with similar functionality (output data) from different suppliers.
    I would post an example, but the time it would take me to clean it up is too large. Sorry. If you have any further questions, don't hesitate to ask further questions.
    Shane.
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

  • PXI 6220 - problems with the counter

    Hello all,
    I try to make a buffered counting with counter0 of my PXI card 6220, to count the speed of a motor through a photocell and a sticker over the pulley of the motor.
    I have wired my photocell at PFI8 (source) and I generate a pulse train that I have wired in PFI9.
    The input to the counter is a pulse train 5V high level - 0V low level.
    The problem is that the counter counts sometimes more than 1 pulse for every turn of the motor. However, apparently the pulse train looks ok.
    I don´t know what´s the problem.
    The rising slope of the pulses looks very nice so, I think I could discard it.
    I can suppose that in between pulses there are some glitches at a very high frequency that I cannot see (I have sampled this signal only at 800kHz and at this frequency there are no glitches), but maybe the counter yes, because it works at 20MHz.
    Somebody has experienced this problem. Sometimes ago, using a PCI6221, I solved a similar problem by activating the digital filtering, but it seems it is not possible to activate for this cards. Could somebody confirm it?
    Any ideas will be appreciated.
    Thank you very much in advance!!

    Pete;
    I agree that is a little strange.We don't have such problem reported on our Data Bases.
    A workaround you can try is to make a sinle pulse goes to the source, before start the buffered acquisition, and see if that makes the counter keeps reporting a 1 value.
    You can also try the same thing on another counter of the board to see if that problem is related to the counter you are using.
    Regards
    Filipe A.
    Applications Engineer
    National Instruments

  • New ABAP editor: problems with the paste function

    Hi all,
    for a few weeks, I am working with the new frontend editor now. It is great - however, there is a thing I don't understand using the paste function. Let's make an example:
    i put the following lines into clipboard by highlighting the entire lines and pressing CTRL+C
    select * from ztmk
             where kunnr in s_kunnr.
    after pasting (CTRL+C) it shows up like this:
    select * from ztmk
    where kunnr in s_kunnr.
    Is it a bug or a feature?
    Jörg Krause, GEZE GmbH, Germany

    Hi Rich,
    sorry, I actually upgraded my GUI to 23, but the problem is not solved. Look at this code:
      SELECT * FROM ztmk INTO TABLE lt_ztmk
             WHERE messe IN s_messe AND
                   kunnr_berater IN s_kunnr AND
                   status IN s_statu AND
                   ersda IN s_ersda AND
                   NOT namecpl = space AND
                   country IN s_count AND
                   kontaktid IN s_kntid AND
                   lvorm in s_lvorm.
      SELECT * FROM ztmk INTO TABLE lt_ztmk
      WHERE messe IN s_messe AND
      kunnr_berater IN s_kunnr AND
      status IN s_statu AND
      ersda IN s_ersda AND
      NOT namecpl = space AND
      COUNTRY IN s_count AND
      kontaktid IN s_kntid AND
      lvorm IN s_lvorm.
    the lower select-statement has been pasted from the upper one
    Thanks for answering!
    Jörg

  • Need some help with the Table Function Operator

    I'm on OWB 10gR2 for Sun/Solaris 10 going against some 10gR2 DB's...
    I've been searching up and down trying to figure out how to make OWB use a Table Function (TF) which will JOIN with another table; allowing a column of the joined table to be a parameter in to the TF. I can't seem to get it to work. I'm able to get this to work in regular SQL, though. Here's the setup:
    -- Source Table:
    DROP TABLE "ZZZ_ROOM_MASTER_EX";
    CREATE TABLE "ZZZ_ROOM_MASTER_EX"
    ( "ID" NUMBER(8,0),
    "ROOM_NUMBER" VARCHAR2(200),
    "FEATURES" VARCHAR2(4000)
    -- Example Data:
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (1,'Room 1',null);
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (2,'Room 2',null);
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (3,'Room 3','1,1;2,3;');
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (4,'Room 4','5,2;5,4;');
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (5,'Room 5',' ');
    -- Destination Table:
    DROP TABLE "ZZZ_ROOM_FEATURES_EX";
    CREATE TABLE "ZZZ_ROOM_FEATURES_EX"
    ( "ROOM_NUMBER" VARCHAR2(200),
    "FEATUREID" NUMBER(8,0),
    "QUANTITY" NUMBER(8,0)
    -- Types for output table:
    CREATE OR REPLACE TYPE FK_Row_EX AS OBJECT
    ID NUMBER(8,0),
    QUANTITY NUMBER(8,0)
    CREATE OR REPLACE TYPE FK_Table_EX AS TABLE OF FK_Row_EX;
    -- Package Dec:
    CREATE OR REPLACE
    PACKAGE ZZZ_SANDBOX_EX IS
    FUNCTION UNFK(inputString VARCHAR2) RETURN FK_Table_EX;
    END ZZZ_SANDBOX_EX;
    -- Package Body:
    CREATE OR REPLACE
    PACKAGE BODY ZZZ_SANDBOX_EX IS
    FUNCTION UNFK(inputString VARCHAR2) RETURN FK_Table_EX
    AS
    RETURN_VALUE FK_Table_EX := FK_Table_EX();
    i NUMBER(8,0) := 0;
    BEGIN
    -- TODO: Put some real code in here that will actually read the
    -- input string, parse it out, and put data in to RETURN_VALUE
    WHILE(i < 3) LOOP
    RETURN_VALUE.EXTEND;
    RETURN_VALUE(RETURN_VALUE.LAST) := FK_Row_EX(4, 5);
    i := i + 1;
    END LOOP;
    RETURN RETURN_VALUE;
    END UNFK;
    END ZZZ_SANDBOX_EX;
    I've got a source system built by lazy DBA's and app developers who decided to store foreign keys for many-to-many relationships as delimited structures in driving tables. I need to build a generic table function to parse this data and return it as an actual table. In my example code, I don't actually have the parsing part written yet (I need to see how many different formats the source system uses first) so I just threw in some stub code to generate a few rows of 4's and 5's to return.
    I can get the data from my source table to my destination table using the following SQL statement:
    -- from source table joined with table function
    INSERT INTO ZZZ_ROOM_FEATURES_EX(
    ROOM_NUMBER,
    FEATUREID,
    QUANTITY)
    SELECT
    ZZZ_ROOM_MASTER_EX.ROOM_NUMBER,
    UNFK.ID,
    UNFK.QUANTITY
    FROM
    ZZZ_ROOM_MASTER_EX,
    TABLE(ZZZ_SANDBOX_EX.UNFK(ZZZ_ROOM_MASTER_EX.FEATURES)) UNFK
    Now, the big question is--how do I do this from OWB? I've tried several different variations of my function and settings in OWB to see if I can build a single SELECT statement which joins a regular table with a table function--but none of them seem to work, I end up getting SQL generated that won't compile because it doesn't see the source table right:
    INSERT
    /*+ APPEND PARALLEL("ZZZ_ROOM_FEATURES_EX") */
    INTO
    "ZZZ_ROOM_FEATURES_EX"
    ("ROOM_NUMBER",
    "FEATUREID",
    "QUANTITY")
    (SELECT
    "ZZZ_ROOM_MASTER_EX"."ROOM_NUMBER" "ROOM_NUMBER",
    "INGRP2"."ID" "ID_1",
    "INGRP2"."QUANTITY" "QUANTITY"
    FROM
    (SELECT
    "UNFK"."ID" "ID",
    "UNFK"."QUANTITY" "QUANTITY"
    FROM
    TABLE ( "ZZZ_SANDBOX_EX"."UNFK2" ("ZZZ_ROOM_MASTER_EX"."FEATURES")) "UNFK") "INGRP2",
    "ZZZ_ROOM_MASTER_EX" "ZZZ_ROOM_MASTER_EX"
    As you can see, it's trying to create a sub-query in the FROM clause--causing it to just ask for "ZZZ_ROOM_MASTER_EX"."FEATURES" as an input--which isn't available because it's outside of the sub-query!
    Is this some kind of bug with the code generator or am I doing something seriously wrong here? Any help will be greatly appreciated!

    Hello Everybody!
    Thank you for all your response!
    I had changes this work area into Internal table and changed the select query. PLease let me know if this causes any performance issues?
    I had created a Z table with the following fields :
    ZADS :
    MANDT
    VKORG
    ABGRU.
    I had written a select query as below :
    I had removed the select single and insted of using the Structure it_rej, I had changed it into Internal table 
    select vkorg abgru from ZADS into it_rej.
    Earlier :
    IT_REJ is a Work area:
    DATA : BEGIN OF IT_REJ,
    VKORG TYPE VBAK-VKORG,
    ABGRU TYPE VBAP-ABGRU,
    END OF IT_REJ.
    Now :
    DATA : BEGIN OF IT_REJ occurs 0,
    VKORG TYPE VBAK-VKORG,
    ABGRU TYPE VBAP-ABGRU,
    END OF IT_REJ.
    I guess this will fix the issue correct?
    PLease suggest!
    Regards,
    Developer.

  • Need some help with a counting function

    Hello,
    I use a simple sheet to organize the timetable of my patients. Now I'd like to count how many different patients I attend, without counting a patient twice if I attend him twice a week for example. My sheet looks like this:
    Mon
    Tue
    Wed
    Thu
    John
    Steve
    John
    Wesley
    Mary
    Harry
    Deborah
    Peter
    Arnold
    Carol
    Chris
    Mary
    Sarah
    Karen
    Karen
    Carol
    Larry
    Peter
    So the answer would be 13, because I attend 13 different patients a week. Fields in blank should no be counted, the cell contend changes frequently.
    A friend of mine tried to help me with a countif function but it didn't work out for me, it would count the fields left blank too.
    Any idea?
    Thanks, gabriel

    Hi Gabriel,
    Here's another, more generalized, approach that doesn't need adjusting for maximum number of visits/week at the cost of just a few more formulas.  But only two tables!
    Formula in A2 and copied down:
      =ROUNDUP((ROW(cell)−1)÷$B$27,0)
    Formula in B2 and copied down:
      =IF(MOD(ROW(cell)−1,$B$27)=0,$B$27,MOD(ROW(cell)−1,$B$27))
    The formula in C2 and copied down:
      =OFFSET(Schedule::$A$1,0,B−1)
    The formula in D2 and copied down:
      =IFERROR(OFFSET(Schedule::$A$1,A2,B2−1,rows,columns),"")
    The formula in E2 and copied down:
      =IF(AND(D2≠0,LEN(D2)>0),COUNTIF($D$1:D2,D2),"")
    The formula in F2 and copied down:
      =IFERROR(IF(E=1,1,""),"")
    The formula in F27:  =SUM(F)
    The value in B27 is 4, the number of day columns in the Schedule table. You would change that if you increase or decrease the number of days on which you see patients.
    Column C is cosmetic, not needed in the calculation.
    The error triangle means all of the cells in the Schedule table are already accounted for in the rows above.
    Probably more compact ways to do this but it gets the job done.
    SG

Maybe you are looking for