Guest User

Untitled

a guest
Mar 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. Table1.csv -- input file-1
  2. brand1,brand2,cost1,cost11,cost2,cost22
  3. xyz,abc, - , - ,675.89,32.45
  4. xyz,abc,235.78, 0, - ,87.45
  5. rst,abc,760.67, 0, 0, 987.54
  6. rst,bbc,-450.45,100,89.78,98
  7. ust,bbc,456.78, - ,345.32,32
  8. ust,bbc, - ,32.45,87.54,56.32
  9.  
  10. table2.csv -- input file-2
  11. brandA,brandB,COL
  12. xyz,abc,spark1
  13. rst,abc,spark2
  14. ust,bbc,spark3
  15. xyz,bbc,spark4
  16. ust,abc,spark5
  17.  
  18. requirement to met:
  19. 1.replace "-" with zero(we have few -ve values as well)
  20. 2.
  21. sumof cost1 in table1 sheet where criteria (brand1 in table1 sheet = brandA in table2 sheet) / sumof cost11 in table1 sheet where criteria (brand1 in table1 sheet = brandA in table2 sheet)
  22.  
  23. --(if divide by zero)
  24. sumof cost2 in table1 sheet where criteria (brand2 in table1 sheet = brandB in table2 sheet) / sumof cost22 in table1 sheet where criteria (brand2 in table1 sheet = brandB in table2 sheet)
  25.  
  26.  
  27. 3. output file should have
Add Comment
Please, Sign In to add comment