Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

getting QLIKVIEW to automatiaclly select our current financial week.

Hi, i have created a document but i want qlikview to automatically select the last complete week of our financial year.

E.g.

Week ending 10/01/10 is our week 37. When i open up the document on MONDAY 11/01/10 , i want QLIKVIEW to select WEEK 37 automatically (the last complete week).

Is this easy to set up?

3 Replies
Not applicable

Hi, on version 9, you can click on document properties and go to the triggers tab. Now you can choose the action type as selection and the actual action as select in field. Probably you want to set a variable in the script and use to set a field value.

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi, thanks for your reply.

But the selection will not always be week 37. it will depend what the last completed end of week was. If for example i open the document on 26th Feb 2010 (which is a friday), the last completed end of week would have been SUNDAY 21st Feb which is week 42. So that is the week i would want qlikview to display.

Not applicable

I'm guessing you need some clue on how to calculate the number of the week to make a selection. Probably you want to do something like this in the script, if the application is being reloaded every day:

set SelectedWeek = floor( ( today() - $(=StartOfFiscalYear) ) /7 );

*Notice that the function floor will return the number of the last completed week.

In case your file is not updated every day, you may want to add an action when the document is opened to calculate the SelectedWeek. Once this value is calculated you can use it to set the field selection.

Hope this helps you.