
596 N.W.2d 24 (1999)
8 Neb. App. 475
PIPE AND PILING SUPPLIES (U.S.A.), LTD., a foreign corporation, Appellant,
v.
BETTERMAN & KATELMAN, a Nebraska general partnership, Appellee.
No. A-97-1327.
Court of Appeals of Nebraska.
June 8, 1999.
*27 Jeffrey A. Silver, Omaha, for appellant.
Mary Lou Perry, of Betterman & Perry, Omaha, for appellee.
IRWIN, Chief Judge, and HANNON and SIEVERS, Judges.
HANNON, Judge.
Pipe and Piling Supplies (U.S.A.), Ltd. (P & P), a foreign corporation, sued Betterman & Katelman (B & K), a Nebraska general partnership, to recover $50,000 of the more than $130,000 P & P paid to B & K for legal services rendered from September 3, 1991, to June 11, 1993, on the ground that the legal fees were "excessive and/or unnecessary for a law firm which had environmental law litigation experience." B & K had recovered the last $8,230 of those fees in a previous action and moved for and received a summary judgment of dismissal in the instant case upon the basis of res judicata, but it was denied its prayer for attorney fees and expenses under Neb.Rev.Stat. § 25-824 (Reissue 1995). We conclude that B & K's previous action against P & P barred P & P from any recovery in this action under the principle of res judicata and that the district judge did not abuse her discretion in denying attorney fees under § 25-824. We, therefore, affirm.

BACKGROUND
This is the third appeal between the parties concerning the legal fees charged by B & K for legal services rendered to P & P. The first two appeals were from a case pending in the Sarpy County District Court in which B & K sued for $8,230, the balance it claimed due for legal services it rendered P & P. The first appeal, Betterman & Katelman v. Pipe & Piling Supplies, 95 NCA No. 38, case No. A-94-019, 1995 WL 569315 (not designated for permanent publication), reversed a summary judgment in favor of B & K because a notice was found to be inadequate. In the second appeal, Betterman & Katelman v. Pipe & Piling Supplies, 5 Neb.App. xx (case No. A-96-199, June 3, 1997), this court affirmed in a memorandum opinion a summary judgment in favor of B & K for a balance of attorney fees, but we reversed the trial court's decision which denied B & K prejudgment interest. P & P brought the present case in the district court for Douglas County, Nebraska.
In order to frame the res judicata issues in this appeal, it is necessary to describe the pleaded issues in the Sarpy County case. B & K alleged the organization and residence of the parties. B & K also alleged that on or about September 1, 1991, P & P retained B & K to "represent it in all matters arising out of or connected with the storage of asbestos wrapped pipe at its places of business located in Nebraska"; that it so represented P & P from September 1, 1991, to June 11, 1993; that on May 25, 1993, P & P terminated B & K's representation; and that B & K then withdrew from the cases in which it had appeared on behalf of P & P.
B & K also alleged that the parties had agreed that its representation was on an hourly basis, billed monthly, and that "Defendant is indebted to Plaintiff for legal services provided to and costs incurred on behalf of Defendant by Plaintiff at the special instance and request of Defendant between September 1, 1991 and June 11, 1993, in the sum of $8,230.02." B & K attached to its petition a statement of what it alleged to be P & P's account which included every charge it made to P & P during the parties' relationship. The account showed a balance due of $8,230.02, which B & K prayed for and recovered in the judgment for the Sarpy County case.
In the Sarpy County case, P & P filed an answer admitting the organization and residence of the parties but denying the *28 other allegations. The answer "[f]or its affirmative defense ... alleges the services rendered ... were of no benefit to the defendant." However, P & P failed to answer certain requests for admissions as required by discovery rules, and these admissions were deemed admitted. These admissions proved B & K's case, and the trial court granted summary judgment. We affirmed on that basis.
In this case, B & K in its answers admitted that it rendered legal services to P & P during the alleged period and that it had received fees in excess of $130,000. B & K denied allegations as to specific services and alleged all fees charged were fair and reasonable. As affirmative defenses, B & K alleged that the petition is barred by waiver, estoppel, res judicata, issue preclusion, settlement, and accord and satisfaction and that the alleged action was frivolous. B & K prayed for dismissal of the petition and attorney fees and costs under § 25-824.
B & K moved for summary judgment on the grounds of res judicata and collateral estoppel, and also moved for sanction under § 25-824, that is, attorney fees and costs on the basis that P & P brought a frivolous action in bad faith. The trial court granted the motion for summary judgment and denied B & K's request for sanction without a finding or explanation.

ASSIGNMENTS OF ERROR
P & P appeals, alleging that the trial court erred in granting the summary judgment, and B & K cross-appeals, alleging the trial court erred (1) in denying its plea in abatement and (2) in denying its motion for sanctions. B & K raised the same issue by the plea in abatement as it did by the motion for summary judgment, and therefore, we need not discuss denial of the plea in abatement.

STANDARD OF REVIEW
The applicability of the doctrines of collateral estoppel and res judicata to this case constitutes questions of law. See Kopecky v. National Farms, Inc., 244 Neb. 846, 510 N.W.2d 41 (1994). With regard to questions of law, an appellate court is obligated to reach a conclusion independent from the trial court's conclusion. In re Estate of Wagner, 246 Neb. 625, 522 N.W.2d 159 (1994); Petska v. Olson Gravel, Inc., 243 Neb. 568, 500 N.W.2d 828 (1993).
The standard of review on the trial court's determination of a request for sanctions under § 25-824 is whether the trial court abused its discretion. See Malicky v. Heyen, 251 Neb. 891, 560 N.W.2d 773 (1997).

ANALYSIS
In most situations, whether the facts are analyzed under the name of res judicata or issue preclusion, the end result may be the same, but there still is a considerable difference. The doctrine of res judicata provides that a final judgment on the merits is conclusive upon the parties in any later litigation involving the same cause of action. Petska v. Olson Gravel, Inc., supra. Collateral estoppel applies when an issue of ultimate fact has been determined by a final judgment, and that issue cannot again be litigated between the same parties in a future lawsuit. Id.
In the Sarpy County case, B & K sued to recover the balance it claimed to be owed for legal services rendered to P & P. B & K alleged, and by admissions proved, that the parties agreed that B & K would be paid at an hourly rate. It then attached a complete statement of the account with the alleged hours spent, the services performed, and the charges billed, as well as the payments made by P & P.
In this case, P & P alleged in its petition that B & K billed it for the same legal services over the same time period and that it was charged and paid $50,000 too much for these services. The question is whether the fact that B & K sued for and won a lawsuit in Sarpy County for the *29 balance of fees it claimed to be entitled to receive is res judicata to a case in which P & P is attempting to litigate its claim that the fees paid were too high. The Nebraska Supreme Court has recently said:
Under the traditional rule of res judicata, sometimes called claim preclusion, any rights, facts, or matter in issue directly adjudicated or necessarily involved in the determination of an action before a competent court in which a judgment or decree is rendered upon the merits is conclusively settled by the judgment therein and cannot again be litigated by the parties and privies.
Vann v. Norwest Bank Neb., 256 Neb. 623, 626, 591 N.W.2d 574, 577 (1999).
The doctrine of res judicata provides that a final judgment on the merits is conclusive upon the parties in any later litigation involving the same cause of action. Kerndt v. Ronan, 236 Neb. 26, 458 N.W.2d 466 (1990). The real issue is, What is the cause or causes of action involved in the disputes between the parties in both cases?
P & P, citing Swift v. Dairyland Ins. Co., 250 Neb. 31, 547 N.W.2d 147 (1996), argues that res judicata is not available when the cause of action in the original action is different from the current cause of action. We certainly agree with that proposition. P & P argues that the Sarpy County case settled only one issue, that is, the extent of B & K's claim, no more and no less. Brief for appellant at 7. We do not agree with that statement because, as will be seen, we understand the "extent" of B & K's claim to include more items than P & P's counsel thinks.
P & P goes on to argue that under Nebraska law, it was not required to file a counterclaim. If P & P had a counterclaim against B & K, we would agree that it need not have filed it in the Sarpy County case. See Neb.Rev.Stat. § 25-814 (Reissue 1995). A counterclaim is "one in favor of a defendant and against a plaintiff between whom a several judgment might be had in the action, and arising out of the contract or transaction set forth in the petition as the foundation of the plaintiff's claim, or connected with the subject of the action." Neb.Rev.Stat. § 25-813 (Reissue 1995). As part of our analysis, we observe that the counterclaim arises out of the contract, not that it inheres in the plaintiff's claim. We note by way of example that P & P does not allege that B & K damaged it in some fashion such as negligently losing a lawsuit, which would give rise to a counterclaim, but, rather, the crux of its claim is that B & K charged too much.
If we understand P & P's argument, it would have us believe that B & K sued in Sarpy County claiming a cause of action against P & P for the legal services B & K performed and that now P & P has a cause of action against B & K for attempting to charge too much. In essence, P & P claims that in the Sarpy County action B & K charged too much. We would analyze the situation at the time of the commencement of the Sarpy County suit as that of B & K asserting a cause of action against P & P for the balance due it for legal services rendered. Obviously, one of the expected defenses against such a suit is that legal services rendered were not worth the amount already paid, and such a defendant might well assert a variety of reasons why B & K prayed for too much.
In Vann v. Norwest Bank Neb., supra, the bank argued that Howard D. Vann could have filed a cross-claim in the previous action. In deciding that res judicata did not apply to prevent the action by Vann, the Supreme Court stated that this rule does not mean that the prior judgment is
"conclusive of matters not in issue or adjudicated, and which were not germane to, implied in, or essentially connected with, the actual issues in the case, although they may affect the ultimate rights of the parties and might have been presented in the former action, and is not applicable to issues the *30 trial of which rests within the discretion of the court."
Vann v. Norwest Bank Neb., 256 Neb. at 627, 591 N.W.2d at 577, quoting 50 C.J.S. Judgment § 758 (1997).
In allowing Vann to proceed, the Supreme Court concluded that the claim in the Vann case was not germane to the issue litigated in the previous case. It certainly appears to this court that whether B & K was attempting to charge too much is germane to any action by B & K attempting to collect part of the same attorney fees which are now claimed to be the result of charging too much.
The case of Graham v. Waggener, 219 Neb. 907, 367 N.W.2d 707 (1985), applies the doctrine of res judicata to a situation somewhat similar to the case at hand. Donald D. Graham sued several defendants to collect fees for services rendered on a contract with the defendants after those defendants had successfully recovered against Graham in a previous suit to remove him and for an accounting. Like P & P in this action, Graham claimed that he had made no counterclaim for compensation in the previous case and that therefore, the issue had not been fully litigated. The Graham court stated that a suit for an accounting necessarily means the question of compensation had been addressed, but it also cited matters in the record which established that the previous suit by the defendants addressed the issues of compensation. The Graham court applied the principle of res judicata to preclude its litigation a second time. The Graham court was presented with a more complicated case than the case at hand, but one of the principles in its decision is res judicata on the basis that Graham's compensation was included in the issues of the previous litigation.
In the case at hand, B & K's entitlement to compensation was the only issue litigated in the Sarpy County case, and it follows that res judicata prevents its litigation a second time in this case.
We believe the general rule to be as follows:
[A] valid judgment for plaintiff is conclusive not only as to defenses which were set up and adjudicated, as discussed supra § 774, but also as to those which might have been raised; so that defendant may not set up such defenses in a second action or in further proceedings in the same action, nor may such defenses be used by the former defendant as the basis of a subsequent action against the former plaintiff.

(Emphasis supplied.) 50 C.J.S., supra, § 775 at 328.
The Nebraska Supreme Court has recently expressly recognized and applied the principle contained in the emphasized portion of the above quote in Dakota Title v. World-Wide Steel Sys., 238 Neb. 519, 471 N.W.2d 430 (1991). The facts in that case are so complicated that a summary of them in this opinion would not be helpful. The Dakota Title court cited Henry v. Farmer City State Bank, 808 F.2d 1228 (7th Cir.1986) (where state court's foreclosure proceeding was held to be res judicata to claim of racketeering based on fraud and forgery), and Johnson's Island v. Board of Tp. Trustees, 69 Ohio St.2d 241, 431 N.E.2d 672 (1982) (where plaintiff's case was dismissed without considering constitutionality of ordinance where in prior litigation on validity of ordinance only defense of nonconforming uses had been raised.)
The complicated fact situations in all of these cases makes it difficult to use them as models to demonstrate the correct analysis of the facts in this case for application of the above-quoted rule. The factual situation is very simple in the case at hand. Perhaps a more detailed analysis would be helpful.
We think the situation in this case should be analyzed as follows: "[A]n action on account or open account is appropriate where the parties have conducted a series of transactions for which a balance *31 remains." 1 C.J.S. Account, Action On § 3 at 607 (1985). "In an action on an account, the burden is on the plaintiff to prove the correctness of the account, the reasonableness of the charges, performance on his part, and the balance due." Id., § 28 at 631. In an action on an account, payment or the defense that the work was defective is an affirmative defense, and a defendant may show that the amount claimed is excessive. Id., § 9. "Once a prima facie case is established, the burden falls upon defendant to disprove the existence or correctness of the account, in whole or in part, to show lack of compliance, such as nondelivery or improper performance." Id., § 28 at 633. Of course, all of these issues are germane to the suit on an account and necessarily require a holding that the issues P & P put forth in this action are germane to the previous action by B & K.
In this action, P & P alleges that the charges for legal services were "excessive and/or unnecessary." Whereas in the Sarpy County case, P & P alleged as a defense that the "services rendered ... were of no benefit." These allegations are merely different approaches to the same general issue, that is, that the charges were unreasonable. They are a particularized allegation that the legal services provided were not delivered for the charges included within the account or were unreasonable, depending upon the method chosen to express the same general notion as a defense. Such an issue could probably have been litigated in the Sarpy County case under the allegation of the petition with a general denial, but if not, they certainly could have been litigated under allegation of an affirmative defense. Clearly, these issues could have been litigated in the Sarpy County case without P & P filing a counterclaim. We, therefore, need not address the considerable argument put forth by P & P upon the basis that the failure to file a counterclaim does not preclude a later action on the claim. We affirm the summary judgment of dismissal granted by the trial court.
Cross-Appeal by B & K.
In conjunction with its motion for summary judgment, B & K moved for the court to enter an order assessing its "reasonable attorney's fees and expenses necessarily incurred in connection with prosecuting this Motion for Summary Judgement" under § 25-824.
Section 25-824(2) provides:
[I]n any civil action commenced or appealed in any court of record in this state, the court shall award as part of its judgment and in addition to any other costs otherwise assessed reasonable attorney's fees and court costs against any attorney or party who has brought or defended a civil action that alleges a claim or defense which a court determines is frivolous or made in bad faith.
B & K asked for attorney fees under this provision, and the trial court denied the request. B & K offered no evidence on the issue, and we have only the issues presented by argument as a basis for considering the issue.
The standard of review on the trial court's determination of a request for sanction is whether the trial court abused its discretion. Malicky v. Heyen, 251 Neb. 891, 560 N.W.2d 773 (1997). Frivolous is defined as being a legal position wholly without merit, that is, without rational argument based on law and evidence to support a litigant's position in the lawsuit. First Nat. Bank in Morrill v. Union Ins. Co., 246 Neb. 636, 522 N.W.2d 168 (1994). An action is frivolous when it is prosecuted for an improper motive or when it indisputably has no merit. Shanks v. Johnson Abstract & Title, 225 Neb. 649, 407 N.W.2d 743 (1987).
While we conclude that P & P's position on the res judicata issue is wrong, we cannot say the district court abused its discretion in concluding P & P's position was not wholly or indisputably without merit. Not every legal action wrongly commenced is meritless. The legal proposition *32 cited and argued by P & P's counsel generally appeared to be facially correct and well supported by legal authority. P & P's error appears to have been an error in analyzing the legal positions of the parties. We found it much easier to determine the outcome of this appeal than it was to articulate the reasons. To hold that a lawsuit commenced as a result of an error in analysis is frivolous as a matter of law would make the legal profession a very risky one indeed. We cannot find that the district court abused its discretion in denying sanctions. We, therefore, affirm.
AFFIRMED.
