Solved

How to calculate total?

Posted on 2001-08-02
18
190 Views
Last Modified: 2013-12-18
I have created a form and on that form, it contains 3 product names which will varies depend on what the user enter e.g field 1 contains "Trend",field 2 contains
"Microsoft Office" and field 3 contains "Symantec".
I want to compute the above as the licenses for each product so if there are a lot of forms entered in the view, under one of the column, it will display the total licenses for each product.

I try with this formula but there's error.
temp :=  0;
@If(@Contains(product | product_1 | product_2;"Officescan");temp+1;1)

How do I achieve what I want?
0
Comment
Question by:kopibean
  • 6
  • 6
  • 3
  • +2
18 Comments
 
LVL 4

Expert Comment

by:sloeber
ID: 6343721
Add in your form an extra field (Computed)
Like TotalProducts
Give it as value Field1 : Field2  : Field3
Go to your view and add a column, the first column should have as column value 1
And in the column properties, go to the second tab and choose below under totals "Total"
Your second column is the TotalProducts column with as columnvalue TotalProducts, this column is categorized

This is all
Now you see in the first column the total of each product and the total of all the products.

Greets,
Sloeber
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6343776
Sloeber proposal is good, but...

even better is not to create a new form field and recalculate all documents with this form.
Simply enter the same formula as Sloeber proposed for forms field TotalProducts into second view column formula.
That means, the second column formula is:
Field1 : Field2  : Field3

Greets,
zvonko
0
 
LVL 4

Expert Comment

by:sloeber
ID: 6343824
I was thinking which method I want to use.

The disadvantage of my method is that you've an extra field. And that you must write an agent with as formula @Command([ToolsRefreshSelectedDocs]).And that the size of the database is a little bit bigger.

The advantage is that if you want an overwiew also in other views, you just have to call this field and that it's not necessary to write the formula everytime.
And that if you go to a view you have in the document properties also an overview of all products in one field.
And if you write an agent which use these values that you just call this field.

Like you see, it's just a choice that you make. But it's not so important.

But it's good from zvonko to mention that it's not really necessary to add a field

Greets,
Sloeber
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6344348
forget it Sloeber. this 20 points are mine <|;-)

Hello kopibean,

first of all you do need no agents (hi, hi) and no view column formulas counting "temp+1"
The subtotals and grandtotal are counted by the view itself.

Here the step how to do.
Let us assume your view name is: ProductLicenses
In this view make the first column categorized and mark "ShowTwistieWhenRowIsExpandable".
For this first column value do not take a Field, but select Formula.
The Formula for this first column value is:
@Explode(@ReplaceSubstring(@Implode(product : product_1 : product_2;";");"; ;";";");";")

The implode/explode is done to get ride of this ugly "(NotCategorized)" entries for empty fields.

As second column you need a Total column.
On the property dialog of this second column select in second tab (Sorting) this entries:
Sort=None
Type=Standard
Totals=Total
HideDetailRows=checked


Save this view and look to see.
Is this wath you asked for?

Regards,
zvonko
0
 
LVL 4

Expert Comment

by:sloeber
ID: 6344386
Zvonko forget it ;-),

You make it more complicate then it is.
You must make it easier
and BTW I also dont't use any agent
only for the refresh but that's only one time for the existing documents
and when you write the formula in the view and not in the form, you don't use any agent.
I repeat.

The first column should have as column value 1
And in the column properties, go to the second tab and choose below under totals "Total".
The second column has as value Field1 : Field2  : Field3
, this column is categorized
This is all. Easier isn't possible
Now you see in your first column the totals.

Greets,
Sloeber

ps : zvonko, I'll sent you 5 points because you tried to help
         -----
 ~ c     |
 ~ ;-(|)=
 ~ c     |
         -----
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6344753
...and in the last row you see (Not Categorized) for all empty fields in any of view documents.

It is really a pity that I go to sailing for a week to Netherlands. In other case I would waste my time with this silly jockes on EE to get crazy 20 points. Really funny ;-))

Do not wait for me to come back from sailing...

So long,
zvonko
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6344758
What the heck smiley is that?
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6344779
From: sloeber

I solved the problem myself ;-))
I simply clicked on Total, and hey, I got totals!!!

(ha, ha...)
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6344787
Hai Arun, how are you?
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 10

Expert Comment

by:zvonko
ID: 6344850
to Sloeber:
-------O    //
~ c     |   //
~ ;-(|)=<
~ c     |   \\
-------O    \\

Cheers
0
 

Author Comment

by:kopibean
ID: 6347614
Hi sloeber,

I do not get what you first column should contain. You mention that it should have column value1(what is value1?).
If possible, could you email me a sample database to this address sim_friends@yahoo.com?
Thanks a lot.

To zvonko,
thanks for your efforts too but your solution makes me confused. I do not quite understand it. But thanks for responsing to my problem.
0
 
LVL 4

Expert Comment

by:sloeber
ID: 6347627
hey kopibean,

Just type 1
that's all

greets,
sloeber
0
 

Author Comment

by:kopibean
ID: 6347817
Hi sloeber,

I try your suggested solution but still fails. Maybe there is a mis-interpretation on my problem.
For the view, the first column is to display the product names which is from another form. Then the second column is to display the total licenses for each product (this column value will be computed as when a product e.g "Microsoft Office 97" is entered a lot of times, then it will display the total no that Microsoft Office 97 appears in the form above.) E.g when user 1 create a form,
he enters "Microsoft Office 97" and "Access 2000". Another user creates another form(same form as user 1), he enters "Microsoft Office 97" and "Visual C++", then the column will display under "Microsoft Office 97" the value 2.

How do I achieve what I want to be display in the second column?

Pls help.
Thanks.
0
 
LVL 4

Accepted Solution

by:
sloeber earned 70 total points
ID: 6347896
Kopibean,

I've made an example for you.
I've send it to your emailaddress.

Greets,
Sloeber
0
 

Author Comment

by:kopibean
ID: 6348038
Hi sloeber,

I try your solution but your solution will applies if Word is entered in field 1 and no same occurence will appear in field 1. What I have is for different pcs, most of it have the same programs installed. Thus, how do I ensure that if Word appear in field 1 under pc1(entered by user 1) and Word also appear in field 1 under pc2(entered by user 2). In these situations, Word would have 2 licenses appear under the column.

How do I resolve this situation?
0
 
LVL 4

Expert Comment

by:sloeber
ID: 6348063
if you make for each pc a seperate document, then your problem is solved.
else you must write an agent who makes a rapport for you with all the details

Greets,
Sloeber
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6349099
Thanks for the points guys!

:-)

Stamp thanks for a bigger smiley.
0
 
LVL 4

Expert Comment

by:pratigan
ID: 7995039
How would this work to generate totals for each categorized entry.  Column 1 is sorted and categorized... want sub totals for each categorized entry to appear after the entries ??  Can you test the totals for the view to only display the entries where the total is > 3 say.  That way the view would show all the documents that have a categorized entry with more than 3 documents, give the total and list the entires ?!?!?!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now