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.

Copy value to another GA multiple times
#1
Maybe someone can help me.

I have very much groupsadresses
what i want i have adres 63/1/1 till 63/1/28
i will copy the value of 63/1/1 to 63/1/2 and 63/1/2 to 63/1/3 and so go on till 63/1/28
and the same thing for 63/2/1 till 63/2/28

at the moment i did it like
Code:
Elektra_Verbruik_week0maandag = grp.getvalue('63/1/3')
grp.update('63/1/4', Elektra_Verbruik_week0maandag)
Elektra_Verbruik_week0maandag = grp.getvalue('63/1/2')
grp.update('63/1/3', Elektra_Verbruik_week0maandag)
Elektra_Verbruik_week0maandag = grp.getvalue('63/1/1')
grp.update('63/1/2', Elektra_Verbruik_week0maandag)
...........
........

end so on untill 63/1/28
My question is, is there a more easy way to do this?
Reply
#2
This can be done with a loop in a descending order:
Code:
prefix = '63/1/'
for i = 28, 2, -1 do
  value = grp.getvalue(prefix .. (i - 1))
  grp.update(prefix .. i, value)
end
Reply
#3
Thanks Admin, this is working perfect to me
Reply


Forum Jump: