Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
ansonkhau
Contributor
Contributor

Trigger Previous Day on Open

Hi,

I would like to know how I can trigger my QlikView document such that the date is set to previous day on open.

I tried to make a listbox where if(Date = today()-1,Date), then selected the date and bookmarked it - setting Triggers to open the bookmark.  

The problem is that is, the actual Date does not change and when I open the document the next day, the Date is set to the day before yesterday. 

Thanks,

Anson 

5 Replies
rajni_batra
Specialist
Specialist

u can use trigger select in field as today()-1 or max(actual date)-1

hope to help!!!

muniyandi
Creator III
Creator III

Hi, Try This Method,

ASONDATE IS UR Date Variable

Macro:

SUB PRIDATE

ActiveDocument.Variables("ASONDATE").SetContent ActiveDocument.Evaluate("Date(today()-1)"),false

END SUB

Document Properties-> Macro->Tigger->OnOpen-"Select Our Macro Name Ex:PRIDATE"

Save It.

Or

Refer Atttachment File,

ansonkhau
Contributor
Contributor
Author

Thanks for the Macro idea. I tried running it (first time running macro in QlikView) and I get the Following error.

Regards,

Anson

muniyandi
Creator III
Creator III

Date is Variable ?,if no means set Variable.

Refer Attachment File ,Worked i tested.

Pls, Post your Example file.

Muni

muniyandi
Creator III
Creator III

Hi Anson,

1. Create Variable LASTDATE

2. Macro:

SUB PRIDATE

ActiveDocument.Variables("LASTDATE").SetContent ActiveDocument.Evaluate("Date(today()-1)"),false

END SUB

3. Trigger set onopen

4. Change Ur Expression if(Date=LASTDATE,Date)

5. Reload & Save and Close it. Then open ur document.