Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have the following problem:
The following load script:
BusTimeTable:
Load *,
BusNumber&StartJourney&EndJourney as KeyBusPax;
Load * inline
[
BusNumber, StartJourney, EndJourney, FromStation, ToStation, Section
201, A, B, A, B, None
201, B, C, B, C, None
201, A, C, A, B, 1
201, A, C, B, C, 2
202, A, C, A, C, None];
generates this table:
Traveller | BusNumber | StartJourney | EndJourney | FromStation | ToStation |
Daniel | 202 | A | C | A | C |
Jane | 201 | B | C | B | C |
Jim | 201 | A | B | A | B |
John | 201 | A | C | A | B |
John | 201 | A | C | B | C |
Tom | 201 | A | B | A | B |
I would like to compute the maximum number of occupied seats on a given bus (e.g. BusNumber 201) for a given Journey (e.g StartJourney = A; EndJourney = C) as follows:
1) Get all the lines with StartJourney A, EndJourney C and BusNumber 201, and get all the sections FromStation - ToStation with this Journey A C :
3) For each section, compute the number of Travelers on this bus, regardless of the StartJourney and EndJourney A-C:
4) Compute the max of these sections above : Max (3,2) = 3
==> The maximum number of occupied seats on a given bus (e.g. BusNumber 201) for a given Journey (e.g StartJourney = A; EndJourney = C) = 3
Thanks a lot
Annick
This seems a little complicated, but can you provide how the final information is displayed? In a chart? in a text box? multiple objects? Can you provide the expected output you would want your users to see based on the inputs provided?