Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
hugmarcel
Specialist
Specialist

Dynamic initial state: How to define?

Hi

I have a report which creates new weekly data every week (sales for week 1, week2, week3 etc.).

Now when the user clicks "initial state" in the top menu bar, always the latest week should be selected.

As we are using Ajax Client, it is not possible to use OnOpen event when the report is being opened.

Any idea how to create a dynamic inital state?

thx - Marcel

3 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I don't know of any way to make an initial state dynamic, but you could use a Select in Field action on the button or text box that the user clicks. Set the field Weeks to =Max(Weeks) (adjust as required).

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
hugmarcel
Specialist
Specialist
Author

Hi

thank you for this proposal. The problem is that the amount of data is massive in the report and an initial selection of the latest week is really needed and must therefore be forced. It should never happen that no week has been selected (but this happens when the user clicks the initial state button but not the user-button).

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I assume that your concern is that some of the objects render slowly or fail i not week is selected?

If that is the case, you have a couple of approaches that you can try.

  • Use conditional calculation or conditional display of the objects, so that the problem objects are not calculated unless a single week is selected.
  • Use "Select one value only" for the week. This may not result in the latest week, but at least your model/objects won't fail.
  • If you are only concerned about the latest wee, load only that week.
  • Use set expressions in your objects so that they only display for max(Week). This will be the latest week if nothing is selected, the selected week if one week is selected, or the most recent of the selected week if more than one is selected.

Hope those help

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein