Sign Up

❇️ OrclQA.Com is a question and answer forum for programmers.
❇️ Here anyone can ask questions and anyone can answer to help others.
❇️ It hardly takes a minute to sign up and it is 100% FREE.

Have an account? Sign In


Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have a permission to ask a question, You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

OrclQA.Com

OrclQA.Com Logo OrclQA.Com Logo

OrclQA.Com Navigation

  • Ask Question
  • Write a Tutorial
  • Online Courses
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Blog
  • New Questions
  • Tutorials
    • Oracle
    • Oracle Apex
    • Python
  • Tags
  • Users
  • Badges & Points
  • Image to Base64
  • PL/SQL Beautifier
  • Ask Question
  • Write a Tutorial
  • Online Courses
khaled sawafteh
khaled sawafteh

khaled sawafteh

  • 4 Questions
  • 6 Answers
  • 0 Best Answers
  • 41 Points
View Profile
  • 0
khaled sawaftehContributor
Asked: September 28, 20202020-09-28T15:07:41+05:30 2020-09-28T15:07:41+05:30

summary column in oracle apex interactive grid

  • 0
Advertisement

I used the JavaScript code it does not work please give me an example to calculate sum from column (QTY) thanks

oracle apexsum colomn
  • 4
  • 702
  • 0
  • 0
  • Share
    • Share on Facebook
    • Share on Twitter
    • Share on LinkedIn
Answer
    Advertisement

    4 Answers

    1. Vinish

      Vinish

      • 1 Question
      • 863 Answers
      • 74 Best Answers
      • 4k Points
      View Profile
      Vinish Enlightened
      2020-09-28T15:37:04+05:30Added an answer on September 28, 2020 at 3:37 pm

      Try this:

      Provide a static id to your grid, for example, igemp, then execute the below JavaScript code using a DA:

      var model = apex.region("igemp").widget().interactiveGrid("getViews", "grid").model;
      var n_qty, n_totqty = 0;
      col_qty = model.getFieldKey("QTY");
      model.forEach(function(igrow) {
          n_qty = parseInt(igrow[col_qty], 10);
          if (!isNaN(n_qty)) {
              n_totqty += n_qty;
          }
      });
      • 0
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
      • khaled sawafteh

        khaled sawafteh

        • 4 Questions
        • 6 Answers
        • 0 Best Answers
        • 41 Points
        View Profile
        khaled sawafteh Contributor
        2020-09-29T12:07:29+05:30Replied to answer on September 29, 2020 at 12:07 pm

        Thanks Dr. vanish it is work

        • 1
        • Share
          Share
          • Share on Facebook
          • Share on Twitter
    2. abumahmoud

      abumahmoud

      • 0 Questions
      • 1 Answer
      • 0 Best Answers
      • 28 Points
      View Profile
      abumahmoud Contributor
      2020-11-01T03:49:52+05:30Added an answer on November 1, 2020 at 3:49 am
      This answer was edited.

      Hi,

      also you can solve it for debit or credit values, i.e. as follows:

      var model = apex.region("test_ig").widget().interactiveGrid("getViews", "grid").model;
      
      var totAmount = 0;
      var vSign = parseFloat(-1);
      
      model.forEach(function(r) {
      var actionType = model.getValue(r,"ACTION_TYPE").v;
      var v_jdAmount = parseFloat(model.getValue(r,"JD_AMOUNT"));
      
      if (!isNaN(v_jdAmount)) {
      if (actionType == 'C') totAmount += v_jdAmount;
      if (actionType == 'D') totAmount += -1*v_jdAmount;
      console.log("it is "+ actionType + " " + v_jdAmount);
      }
      
      });
      $s('P33_TOTAL',totAmount);
      
      

      thank you

      • 1
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
      • khaled sawafteh

        khaled sawafteh

        • 4 Questions
        • 6 Answers
        • 0 Best Answers
        • 41 Points
        View Profile
        khaled sawafteh Contributor
        2022-01-12T17:49:36+05:30Replied to answer on January 12, 2022 at 5:49 pm

        Dear

        I try this code does not work please advice

        tks

        • 0
        • Share
          Share
          • Share on Facebook
          • Share on Twitter

    You must login to add an answer.

    Forgot Password?

    Advertisement

    Sidebar

    Ask Question
    Write a Tutorial
    Advertisement

    Recent Blog Posts

    • Vinish

      Oracle LENGTH()

    • Vinish

      Oracle INSTR() Function

    • Vinish

      Oracle INITCAP() Function

    • Vinish

      Oracle Concat

    • Vinish

      Oracle CHR Function

    Advertisement
    Advertisement

    Explore

    • Home
    • Blog
    • New Questions
    • Tutorials
      • Oracle
      • Oracle Apex
      • Python
    • Tags
    • Users
    • Badges & Points
    • Image to Base64
    • PL/SQL Beautifier

    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
    © 2021 OrclQA.Com. All Rights Reserved.
    Privacy Policy - About Us