Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In my app, I have a date field that represents the total number of policies as of a specific date. I would like to use the Always One Selected Value option on this date field because it's 12 month rolling. However, I would like to provide a line chart to show trending, which is obviously useless if you can only select one point in time.
Here is an example of my data:
AsOf | Policies_Eligible | Pols_With_Coverage |
2/28/2019 | 100 | 20 |
3/31/2019 | 50 | 30 |
4/30/2019 | 50 | 50 |
So as of 2/28/2019, there were 100 eligible policies and 20 policies with the specific coverage. When the user selects a date range of 2/28/2019-4/30/2019, it would show that we had 200 eligible policies, and 100 policies with the feature, which isn’t correct. I want to show only one point in time at a time for every chart object in the app, EXCEPT FOR the line chart. Is there a way to achieve this?
Hi,
so use an expression like
count({<Date={">=$(=date(addyears(max(Date),-1)))<=$(=date(max(Date)))"}>} Policy)
where you count all values between max date (=selected value) and max date - 1 year
Regards
Hi Martinpohl,
Sorry, I just updated the post with more information. My data shows 12 months rolling before being imported into Qlik.
Regards
You have lots of options.
1. Use the always one selected and in the line chart expression ignore the AsOf selection.
=count({<AsOf=>} Policies_Eligible)
2. Don't use Always one Selected and in your charts where you want a single date limit to the max AsOf:
=count({<AsOf="$(=Date(Max(AsOf)))">} Policies_Eligible)
3. Use an alternate state for the line chart to allow for a custom AsOf range selection.
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
Thank you, Rob! I didn't think of ignoring the AsOf selections. I do have some other requirements that cause issues with your proposed solutions..
1. This works, but the chart shows the full range of dates, and I am unable to allow the consumer to make selections. The data is over several years, so we would want to all selections.
2. I could do this, but then I'm allowing my users to make multiple selections in the filter pane, but only showing the most recent value. I could try to make this clear with a text box, but I don't really love that solution.
3. I planned on using the alternate state for the line chart, but the Always One Selected setting is across all states, so that doesn't solve this particular issue..
Thank you!