Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
kritikak
Contributor
Contributor

Insert two Dates with one year difference in search string while triggering the Multibox.

i want to Insert two Dates with one  year difference in search string while triggering the Multibox so that when i open my sheet by default teh two dtaes are being selected. One should be the max(timekey) other should be year before the max(timekey).

 eg date 1= max(timekey) = jul18 then date2 should be =jul17

i am using ='('max(Timekey)&'|'& AddYear(max(Timekey),-1)&')'  by facing issues

1 Reply
marcus_sommer

Try it with:

$(= '(' & date(max(Timekey), 'MMMYY') & '|' & date(AddYear(max(Timekey),-1), 'MMMYY') & ')')

whereby Timekey must be a numeric or a dual-value and your default variable (at the start of he script tab main) must fit to the formatting of your field Timekey.

- Marcus