Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Views??
Sat, Jun 30 2018 4:49 AMPermanent Link

Ian Branch

Avatar

Hi Team,
   Thought I would create a view that was a subset of a LineItems and add a couple of calculated fields.
   So, I did the following..
   Added a calculated field to LineItems.  QtyUsed * SellPrice
   Then ran the following.
   {sql}
      CREATE VIEW "vLineItems" as select * from Lineitems
   {sql}
   It created the vLineItems OK.
   I then went and deleted the calculated field from LineItems.
   Surprise!  The calculated field disappeared from the View. Frown
   Ummm. What the??
   This is not my experience with Views..
   What have I done is obviously wrong so how do I get the calculated field into the view?

Regards & TIA,
Ian
Sat, Jun 30 2018 9:12 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian


I don't have much (any) use for views so my knowledge is very limited. Having said that a view is basically a query and its done exactly what you asked it to do - show all columns in LineItems. If you want it to show a calculated column either leave the column in LineItems or spwcifically add it into vLineItems eg

{sql}
CREATE VIEW "vLineItems" as select *, QtyUsed * SellPrice AS Sales from Lineitems
{sql}

If you'd created a subset of columns, naming those you wanted, I suspect that you'd have received an error message.

Roy Lambert
Sat, Jun 30 2018 6:48 PMPermanent Link

Ian Branch

Avatar

Hi Roy,

   I have used them on the odd occaision in the past.  Particularly for reports.

   I have found them useful for create "tables" that are used by reports as they don't physically exist aside from in the
Catalog and can contain much of the stuff you might be trying to do in the reports.  e.g. qtyused * SellPrice.  Let the
Database do the work rather than the Report.

Regards,
Ian
Sun, Jul 1 2018 2:39 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian


I've either used in-memory tabes, or more likely a mindset that says

  keep it in the report
  I can see what's happening if I need to look at the report
  The extra time taken by comparison with formatting and printing is nowt


I generally find its easier to spot I put the decimal point in the wrong place doing it that way YMMV

Roy Lambert
Fri, Jul 6 2018 3:00 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ian,

<< I then went and deleted the calculated field from LineItems. Surprise!  The calculated field disappeared from the View. Frown>>

I assume that you mean "computed" or "generated" when you say "calculated" ?

If you drop a column from the underlying table, then EDB will allow adjust the view accordingly.

Tim Young
Elevate Software
www.elevatesoft.com
Image