lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Group quotes, part deux


From: Greg Chicares
Subject: Re: [lmi] Group quotes, part deux
Date: Wed, 11 May 2016 14:39:01 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0

On 2016-05-11 13:01, Vadim Zeitlin wrote:
> On Sun, 8 May 2016 22:16:25 +0000 Greg Chicares <address@hidden> wrote:
> 
> GC> Here's the logic:
> GC> 
> GC>     if(totals_.total(e_col_supplemental_face_amount))
> GC>         {
> GC>         suppress(e_col_supplemental_face_amount);
> GC>         suppress(e_col_total_face_amount);
> GC>         }
> GC>     if(totals_.total(e_col_additional_premium))
> GC>         {
> GC>         suppress(e_col_additional_premium);
> GC>         suppress(e_col_total_premium);
> GC>         }
> 
>  Sorry but isn't this logic reversed?

Thanks, yes; the conditions for suppression should instead be:

    if(0.0 == totals_.total(e_col_supplemental_face_amount))
    if(0.0 == totals_.total(e_col_additional_premium))

> GC> I was going to insert that logic where add_column() is called, but
> GC> it appears that the headers and totals are affected, too, so could
> GC> I ask you to do that? One idea, FWIW, is to add a 'suppressed_'
> GC> member to totals_data (which might then be renamed "aggregate_data"
> GC> as you suggest elsewhere), and set that member in a "finalization"
> GC> step after all totals have been captured. But now that I re-read
> GC> your comments above, you mention changing class wx_table_generator,
> GC> so you might have a better idea already in mind that will cover the
> GC> headers and totals in a cleaner way.
> 
>  Yes, my idea was to just allow having hidden columns at this level. I.e.
> the columns are still added (almost) as usual, but some of them can be
> marked as being hidden and don't appear in the output. This has the
> advantage of not requiring any other changes to the code.

Sounds great. Nowhere near as messy as what I would have done.

> GC> In this case, though, we have at most three averages, one for each
> GC> "premium" column. The averages are to go in a row of their own below
> GC> the totals, to be labelled "Average Cost per $1000". The averages are
> GC>   1000 * premium / face_amount
> GC> for these {premium, face_amount} pairs:
> GC>   "Basic", "Basic"
> GC>   "Additional", "Supplemental" [a real problem-domain distinction]
> GC>   "Total", "Total"
> GC> There's so little to calculate here that it may as well be done on the 
> fly.
> GC> Would you mind if I asked you to implement this?
> 
>  This doesn't seem difficult, but I'm not sure to understand how exactly is
> this supposed to look like, could you please help me with my (ASCII) mock
> up? Here is how it is now:
> 
>                   ----------------------------------------------------------
>                   |                                                        |
> ----------------------------------------------------------------------------
> | Census   Totals:| $ n,nnn | $ n,nn | $ n.nn | $ n.nn | $ n,nnn | $ n,nnn |
> ----------------------------------------------------------------------------
> |      |          | Basic   | Basic  | Suppl. | Addit. | Total   | Total   |
> |      |          |  Face   | Annual |  Face  | Annual |  Face   | Annual  |
> | Part#| ...      | Amount  | Premium| Amount | Premium| Amount  | Premium |
> ----------------------------------------------------------------------------
> 
> I understand that a row with "Average Cost per $1000" needs to be added
> below the "Census ... Totals" one, but it's not clear where should the
> "Census" label go. Aesthetically it would seem to be best to centre it
> vertically, but this is not something that can be easily done with the
> current code, so it would be simpler if this could be avoided.

Right-justify it as "Totals:" is right-justified.
Italicize it as "Totals:" is italicized.

> I'm also not
> sure what, if anything, should be shown for the amount columns.

Averages can be empty strings for the face-amount columns.

> Or should,
> perhaps, these averages centered and span the pair of columns each too? But
> how would this work if one of "Supplemental Face Amount" and "Additional
> Annual Premium" columns is hidden, but the other one is not?

No need for such complexity, which would actually be harmful. The averages
pertain to the premium columns only. Thus, the question in the "But...not"
sentence isn't even reached.

>  It would be ideal if you could please just copy and paste my ASCII art
> (surely it can be called nothing else) above with the desired changes, but
> I'd also accept a thousand words of explanation -- you'll probably need at
> least that many because currently I'm rather lost, even if this seems like
> a completely trivial problem.

                    ----------------------------------------------------------
                    |                                                        |
  ----------------------------------------------------------------------------
- | Census   Totals:| $ n,nnn | $ n,nn | $ n.nn | $ n.nn | $ n,nnn | $ n,nnn |
+ |     Average...:*|         | $ n.nn |        | $ n.nn |         | $ n.nn  |
  ----------------------------------------------------------------------------
  |      |          | Basic   | Basic  | Suppl. | Addit. | Total   | Total   |
  |      |          |  Face   | Annual |  Face  | Annual |  Face   | Annual  |
  | Part#| ...      | Amount  | Premium| Amount | Premium| Amount  | Premium |
  ----------------------------------------------------------------------------

The new line adds averages. The asterisk indicates that there isn't enough
space to write the full "Average Cost per $1000:" label in ASCII art, but
there seems to be plenty of room for it in the PDF. Please format the
averages exactly the same way "Premium" totals are presently formatted in
HEAD, or with a comma-less format if that's easier (because the average
can never be 1,000.00 or greater--it can't plausibly even be close).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]