how do i calculate the percentage of a attribute crystal report











up vote
0
down vote

favorite












Hi I am trying to find the number of fix time calls that are below 2 hrs and then calculate what the percentage of the calls that 2 hours or below.



I know that I need to find the sum of the call first that are under 2 hrs and then calculate the percentage of call of 2 hrs or under.
Below I have the code of the fix time.



WhilePrintingRecords;
datetimevar recovery;
numbervar total_fixtime;
numbervar fixtime;
numbervar fixtimetemp;

datetimevar fixrec;
datetimevar fixresp;
timevar fixstart;
timevar fixend;

if recovery = datetime(date(0,0,0),Time(0,0,0)) then
if(Date({Calls.Completion_Date})>Date(maximum({Call_Events.Off_Site},{Calls.Call_Ref}))) then
fixresp:=maximum({Call_Events.Off_Site},{Calls.Call_Ref})
else

fixresp := {Calls.Completion_Date}
else
fixresp := recovery;

fixrec := Minimum({Call_Events.On_Site},{Calls.Call_Ref});
fixstart := time(09,00,00);
fixend := time(17,00,00);
//fixtimetemp := Diff_dates_cmpl (fixrec,fixresp,fixstart,fixend,false);
//fixtime := fixtimetemp/60 ;
//total_fixtime := total_fixtime + fixtime;
//fixtime;
if({Calls.Last_Allocated_To} startswith "OMS") then
(
fixtimetemp := Diff_dates_callScotland (fixrec,fixresp,fixstart,fixend,false);
)
else
(
fixtimetemp := Diff_dates_cmpl (fixrec,fixresp,fixstart,fixend,false);
);
fixtime := ( fixtimetemp/60 ) ;
total_fixtime := total_fixtime + fixtime;
fixtime


I know I could use a if statement to say if {fixtime} < 2 then :
I want the sum else 0
then I could calculate the percentage of this calls










share|improve this question




























    up vote
    0
    down vote

    favorite












    Hi I am trying to find the number of fix time calls that are below 2 hrs and then calculate what the percentage of the calls that 2 hours or below.



    I know that I need to find the sum of the call first that are under 2 hrs and then calculate the percentage of call of 2 hrs or under.
    Below I have the code of the fix time.



    WhilePrintingRecords;
    datetimevar recovery;
    numbervar total_fixtime;
    numbervar fixtime;
    numbervar fixtimetemp;

    datetimevar fixrec;
    datetimevar fixresp;
    timevar fixstart;
    timevar fixend;

    if recovery = datetime(date(0,0,0),Time(0,0,0)) then
    if(Date({Calls.Completion_Date})>Date(maximum({Call_Events.Off_Site},{Calls.Call_Ref}))) then
    fixresp:=maximum({Call_Events.Off_Site},{Calls.Call_Ref})
    else

    fixresp := {Calls.Completion_Date}
    else
    fixresp := recovery;

    fixrec := Minimum({Call_Events.On_Site},{Calls.Call_Ref});
    fixstart := time(09,00,00);
    fixend := time(17,00,00);
    //fixtimetemp := Diff_dates_cmpl (fixrec,fixresp,fixstart,fixend,false);
    //fixtime := fixtimetemp/60 ;
    //total_fixtime := total_fixtime + fixtime;
    //fixtime;
    if({Calls.Last_Allocated_To} startswith "OMS") then
    (
    fixtimetemp := Diff_dates_callScotland (fixrec,fixresp,fixstart,fixend,false);
    )
    else
    (
    fixtimetemp := Diff_dates_cmpl (fixrec,fixresp,fixstart,fixend,false);
    );
    fixtime := ( fixtimetemp/60 ) ;
    total_fixtime := total_fixtime + fixtime;
    fixtime


    I know I could use a if statement to say if {fixtime} < 2 then :
    I want the sum else 0
    then I could calculate the percentage of this calls










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Hi I am trying to find the number of fix time calls that are below 2 hrs and then calculate what the percentage of the calls that 2 hours or below.



      I know that I need to find the sum of the call first that are under 2 hrs and then calculate the percentage of call of 2 hrs or under.
      Below I have the code of the fix time.



      WhilePrintingRecords;
      datetimevar recovery;
      numbervar total_fixtime;
      numbervar fixtime;
      numbervar fixtimetemp;

      datetimevar fixrec;
      datetimevar fixresp;
      timevar fixstart;
      timevar fixend;

      if recovery = datetime(date(0,0,0),Time(0,0,0)) then
      if(Date({Calls.Completion_Date})>Date(maximum({Call_Events.Off_Site},{Calls.Call_Ref}))) then
      fixresp:=maximum({Call_Events.Off_Site},{Calls.Call_Ref})
      else

      fixresp := {Calls.Completion_Date}
      else
      fixresp := recovery;

      fixrec := Minimum({Call_Events.On_Site},{Calls.Call_Ref});
      fixstart := time(09,00,00);
      fixend := time(17,00,00);
      //fixtimetemp := Diff_dates_cmpl (fixrec,fixresp,fixstart,fixend,false);
      //fixtime := fixtimetemp/60 ;
      //total_fixtime := total_fixtime + fixtime;
      //fixtime;
      if({Calls.Last_Allocated_To} startswith "OMS") then
      (
      fixtimetemp := Diff_dates_callScotland (fixrec,fixresp,fixstart,fixend,false);
      )
      else
      (
      fixtimetemp := Diff_dates_cmpl (fixrec,fixresp,fixstart,fixend,false);
      );
      fixtime := ( fixtimetemp/60 ) ;
      total_fixtime := total_fixtime + fixtime;
      fixtime


      I know I could use a if statement to say if {fixtime} < 2 then :
      I want the sum else 0
      then I could calculate the percentage of this calls










      share|improve this question















      Hi I am trying to find the number of fix time calls that are below 2 hrs and then calculate what the percentage of the calls that 2 hours or below.



      I know that I need to find the sum of the call first that are under 2 hrs and then calculate the percentage of call of 2 hrs or under.
      Below I have the code of the fix time.



      WhilePrintingRecords;
      datetimevar recovery;
      numbervar total_fixtime;
      numbervar fixtime;
      numbervar fixtimetemp;

      datetimevar fixrec;
      datetimevar fixresp;
      timevar fixstart;
      timevar fixend;

      if recovery = datetime(date(0,0,0),Time(0,0,0)) then
      if(Date({Calls.Completion_Date})>Date(maximum({Call_Events.Off_Site},{Calls.Call_Ref}))) then
      fixresp:=maximum({Call_Events.Off_Site},{Calls.Call_Ref})
      else

      fixresp := {Calls.Completion_Date}
      else
      fixresp := recovery;

      fixrec := Minimum({Call_Events.On_Site},{Calls.Call_Ref});
      fixstart := time(09,00,00);
      fixend := time(17,00,00);
      //fixtimetemp := Diff_dates_cmpl (fixrec,fixresp,fixstart,fixend,false);
      //fixtime := fixtimetemp/60 ;
      //total_fixtime := total_fixtime + fixtime;
      //fixtime;
      if({Calls.Last_Allocated_To} startswith "OMS") then
      (
      fixtimetemp := Diff_dates_callScotland (fixrec,fixresp,fixstart,fixend,false);
      )
      else
      (
      fixtimetemp := Diff_dates_cmpl (fixrec,fixresp,fixstart,fixend,false);
      );
      fixtime := ( fixtimetemp/60 ) ;
      total_fixtime := total_fixtime + fixtime;
      fixtime


      I know I could use a if statement to say if {fixtime} < 2 then :
      I want the sum else 0
      then I could calculate the percentage of this calls







      vba crystal-reports report






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 20 at 10:52

























      asked Nov 20 at 10:33









      haroon

      11




      11





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53391064%2fhow-do-i-calculate-the-percentage-of-a-attribute-crystal-report%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53391064%2fhow-do-i-calculate-the-percentage-of-a-attribute-crystal-report%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          To store a contact into the json file from server.js file using a class in NodeJS

          Redirect URL with Chrome Remote Debugging Android Devices

          Dieringhausen