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

VB Script embed into Buttons

Have a requirement to make a selection active on a basis of Button. Following is working when its a single selection:

ActiveDocument.GetField(

"SFDC_OPPORTUNITY.Month"). Select ActiveDocument.Evaluate("monthname(today(0))")

where SFDC_OPPORTUNITY.Month is the tablename.fieldname from the Load Script which need to select based on the Button click.



The requirement says on the click of the Button, need to show last 12 months data starting from current month. How can that be programed in the embedded VBscript? Has anyone faced this kind of requirement before?

Any help is appreciated.

Thanks,

Gaurav C

1 Solution

Accepted Solutions
Not applicable
Author

Please consider it solved after lot of permutation and combination and offcourse help from google:

ActiveDocument.Fields("SFDC_OPPORTUNITY.Month"). Select ">=" & FormatDateTime(ActiveDocument.Evaluate("today(1)-365"))

This does the trick.

Thanks,

Gaurav C

View solution in original post

3 Replies
Not applicable
Author

could you post a QVW with an example of your data?

Not applicable
Author

Please find attached a test qvw.

LTM - Lost Button need to select last 12 months. The current underlying macro is able to select the current month as per the code.

Thanks,

Gaurav C

Not applicable
Author

Please consider it solved after lot of permutation and combination and offcourse help from google:

ActiveDocument.Fields("SFDC_OPPORTUNITY.Month"). Select ">=" & FormatDateTime(ActiveDocument.Evaluate("today(1)-365"))

This does the trick.

Thanks,

Gaurav C