How to get Sum total of a value in a table of the latest entered data and not summate older values?

We have a content type called Yard Inventory which references to a content type Yard using Entity Reference. There is a field called Hives in Yard Inventory and now we want to find the Total Hives based on just the latest entry made, excluding the previous entries.

Comments

Michael-IDA’s picture

To verify: You want the sum of all Hives for the last Yard entered?
(Or, if I extracted that wrong, re-write your wants into a single sentence.)

Sure, send me your DB.

Best,
Michael

Drupal Hosting

NIH Cancer Study: Supplemention with both vitamins and fenbendazole exhibited significant (P = 0.009) inhibition of tumor growth.

cooldeeponline’s picture

Hi Michael,

Thank you for your response.

We want to find the 'Sum of Total Hives' from the latest values entered in all the Yards and not just 'the last Yard entered.'

We have several Yards like Hucks, Bent etc. so we want to display something like 'Total Hives: 451' in a Block. Calculation should take values from all the latest entries made in the respective Yards.

For example Latest Hive Entry was made in Yard: Hucks on 1st Jan.
Latest Hive Entry was made in Yard: Bent on 31st Dec.
Latest Hive Entry was made in Yard: Willow on 5th Nov.

So, now we just want 'Total Hives' bases on these Latest Entries and it should not consider any of the previous entries for the respective Yards.

If you could PM us your 'email address' I will be glad to send you our DB and also give access to our site.

Thanks a lot!

Kuldeep