This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

CSV report
#2
Code:
rows = { 'name,actual_value,start_month,current_month,previous_month' }

function pushrow(i)
  local actual_value_obj = grp.find('3/1/' .. i)
  local name = actual_value_obj.name
  local actual_value = actual_value_obj.value
  local start_month = grp.getvalue('2/1/' .. i)
  local current_month = grp.getvalue('4/1/' .. i)
  local previous_month = grp.getvalue('1/1/' .. i)

  rows[ #rows + 1 ] = name .. ',' .. actual_value .. ',' .. start_month .. ',' .. current_month .. ',' .. previous_month
end

-- from 3/1/1 to 3/1/15
for i = 1, 15 do
  pushrow(i)
end

-- from 3/1/20 to 3/1/30
for i = 20, 30 do
  pushrow(i)
end

--csv = table.concat(rows, '\r\n')
csv = string.char(0xEF, 0xBB, 0xBF) .. table.concat(rows, '\r\n')
Reply


Messages In This Thread
CSV report - by akn - 06.02.2019, 21:51
RE: CSV report - by admin - 07.02.2019, 08:46
RE: CSV report - by akn - 30.03.2019, 22:41

Forum Jump: