Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Is it possible to select variable values automatically?

Hi,

I have qvw with macro which will send data to user email automatically. All is fine. The qvw contains two variables

VStartDate and vEndDate.

The data used to send every Monday before 12pm to user email. The completed week data will send. I,e Suppose today is Monday. so, the variables VStartDate and vEndDate contains

VStartDate=21/04/2014 and vEndDate= 25/04/2014. Like this I will manually selecting variables values every week.

My question is, Is there any solution that variables set automatic. I,e without my interference the variable should take before weeks dates. why I am asking is I don't want to miss the data any case in my absence.

Can anyone please suggest me this?

Thanks.

1 Solution

Accepted Solutions
Not applicable
Author

ok..so every monday you open your .qvw with "C:\Program Files (x86)\QlikView\Qv.exe" /r "E:\Qlikview\Documents\EveryMondayReport\ItemReport.qvw" like you posted before so after this you create in the document properties a trigger onopen to clear the selection and to load the script. do you know how to create a trigger??

then you create a trigger on PostReload where you set the variables for your date and a trigger onpostreload to run your macro.

this should send the e mail automatically.

I hope it helps you and leads you in the right direction.

regards,

MT

View solution in original post

53 Replies
ashwanin
Specialist
Specialist

Hi Amelia,

What it reflects that your Start date and End date is based on the week start date and end date

So for vStart date you can use use =WeekStart(Date(Today()-1))

and for end date use  =WeekEnd(Date(Today()-1))

Not applicable
Author

Thanks. Where I need to give this?

Not applicable
Author

I just gave this in variables values. Is that you mean. If so, is there any macro to use this?

Roop
Specialist
Specialist

Set the variables in QlikView and then use something like this code in the Macro:

set v = ActiveDocument.Variables("vQlikViewVariable")

v.SetContent vMacroVariable, true

R

Not applicable
Author

Thanks.

It's working.

Roop
Specialist
Specialist

My guess is that you have set v and are using V in the SetContent so I would guess it is a problem of case .... ?

Not applicable
Author

Yes you are right now it's working.

Not applicable
Author

By using batch file I schedule this file to reload manually using Task scheduler. My user can able to receive the email from me through task scheduler, but there is no attached  excel file.  How can I set the attached file?

Not applicable
Author

Sorry. Again I got a problem If I clear all selections I can able to get last week's data. May I know how to set this please?