Dividing one row with another and create new row in same attribute.

pallav
pallav New Altair Community Member
edited November 2024 in Community Q&A
Hello All i have date something like this .


What is want to achieve is divide each attribute with with row value say suppose in "OOP_BUCKET" we have 0-0 for both "Metric" Total claim and Total Reversal . I want to create new row 0-0 % where total count will be "27 / 244281"  and same for 102-204 % rows say suppose APR-18 will be 147 / 5985.3. Attaching sample below . 


The lower rows will be product of division of total reversal / Total claims . 

Thanks in Advance looking forward to get more robust process for this task . 
Tagged:

Best Answer

Answers

  • hbajpai
    hbajpai New Altair Community Member
    Hey @pallav ,

    There are many ways to approach it. From what I gather you could create a datasets with OOP bucket as id's and melt your other columns wrt to claims and reversals (you can use RM pivot operation for this, you might need some pre processing also). You would end up with attributes like Apr-18-Claims and Apr-18-Reversals and then you can just use generate attributes to calculate reversal percentage attributes. Another way could be you have separate tables for claims and reversals and then in a loop filter on ids (OOP-Bucket) and calculate reversal percentage inside the loop using generate attributes operator. Hope this helps, let me know if you have any questions.  
  • pallav
    pallav New Altair Community Member
    @hbajpai - second approach looks fine to me but how to calculate that reversal percentage . 
    do we have some working example like this .?
  • hbajpai
    hbajpai New Altair Community Member
    @pallav
    Can you share your data as a file ?  I can create and send out the process to you.
  • pallav
    pallav New Altair Community Member
    @hbajpai - sorry for delay response . please find the file as attachment.  We have to calculate percentage by dividing "total claim/ total reversal" for each bucket and for each month . 
  • pallav
    pallav New Altair Community Member
    @hbajpai - Months given here like "201801" or 201801 can be dynamic ,
  • pallav
    pallav New Altair Community Member
    Hi- Can anyone assist me here .