Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I am trying to create a macro which selects a particular value of a field, copy the pivot chart to excel and mail it to particular recepients on a Tuesday every week.
I found success in copying the pivot chart to excel and mailing it by creating a button. Inside, in Actions tab selecting External and Run macro and editing the macro.
What i am unable to do is:
Thanks Gysbert,
If DatePart("w",Date()) = 3 then
'do tuesday stuff
Else
'do other days stuff
End if
If ActiveDocument.Fields("Month").Select("September") then
'September was selected, do the september stuff
Else
'September could not be selected, do the other stuff
End if
It's probably easier to create a bookmark instead and activite the bookmark with a OnPostReload trigger.
But can we create dynamic bookmarks in qlikview, since i wanted last weeks data to be sent via mail.
Yes, that's possible. I think these threads can help you:
http://community.qlik.com/thread/31454
http://community.qlik.com/thread/30095
I hope this helps
Hi Gysbert,
Thanks for all your advice, I can now create dynamic bookmarks.
There are two things I want to do now
All this i prefer to write in a macro. Can anyone hardcode it for me.
If DatePart("w",Date()) = 3 then
'do tuesday stuff
Else
'do other days stuff
End if
If ActiveDocument.Fields("Month").Select "September" then
'September was selected, do the september stuff
Else
'September could not be selected, do the other stuff
End if
I follow this and it gives me Expected'Then' kind of error.
HI
Try like this
s = ActiveDocument.Evaluate("GetFieldSelections(Month)")
if s = 'September' then
'do something
else
'do something
end if
Edit:
Sorry, i misunderstand the concept..
Hope it helps
ActiveDocument.Fields("Month").Select("September") does not do what I expect (at least not in QV10, maybe in QV11 it does work). You'll need something like this instead
flag=0
ActiveDocument.Fields("Month").Select("September")
set val=ActiveDocument.Fields("Month").GetSelectedValues
for i=0 to val.Count-1
if val.Item(i).text = "September" then
flag=1
end if
next
if flag=1 then
'September was selected, do the september stuff
Else
'September could not be selected, do the other stuff
End if
Thanks Gysbert,
If DatePart("w",Date()) = 3 then
'do tuesday stuff
Else
'do other days stuff
End if
If ActiveDocument.Fields("Month").Select("September") then
'September was selected, do the september stuff
Else
'September could not be selected, do the other stuff
End if