Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

ansonkhau
New Contributor

Trigger Date Selection from Selecting Days, Months, Years

I have broken down the Date field in Year, Month and Day and would like to know how I can trigger a selection in Date when I select a Day or Month field?

For Example When I select Year = 2012, Month = 9 and Day = 17 then the Date field 9/17/2012 will be selected automatically as well.  If I only selected the Days, then the Dates with those days will be selected. 

Thanks,

Anson 

Tags (3)
1 Solution

Accepted Solutions
MVP
MVP

Re: Trigger Date Selection from Selecting Days, Months, Years

Anson

You have not posted your expression, but I suspect that all you need to do is override the other selections using a set expression, something like

     Sum({<Year=,Month=,Day=,Date={some condition}>} Amount)

where some condition selects the past 30 days of data.

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
6 Replies
rajni_batra
Valued Contributor

Re: Trigger Date Selection from Selecting Days, Months, Years

u can use selectinfield trigger for this

MVP
MVP

Re: Trigger Date Selection from Selecting Days, Months, Years

This sounds very close to default QlikView functionality anyway.  The dates would not be selected, but only the associated ones would be active.  Why do they actually need to be selected?

The above depends on the data model being correct, eg. all the different parts of the date being in the same table a the date itself - or in a joined calendar table.  Is this the case?

If you do need to apply the selection, then Select Possible is probably the way to go - as it would be less coding than Select In Field.

- Steve

ansonkhau
New Contributor

Re: Trigger Date Selection from Selecting Days, Months, Years

Hi Steve,

The Year, Month, Day are just broken down from the Date field. The reason I want to do this is, I have a few charts that plot the past 30 days based on Date. My date selections are broken down by Year Month and Day for easy access by the user. However, when the user clicks on a specific date using the Year Month Day, the chart no longer shows the past 30 days of data. When I tried to select the actual date from the Date field, the chart works properly.

Thanks,

Anson

MVP
MVP

Re: Trigger Date Selection from Selecting Days, Months, Years

Hi there, it sounds like you may require some Set Analysis to achieve what you are after.  This applies an enforced selection over the top of the users selection.

Are you able to upload a copy of your document with anonymised data and a description of what you are aiming to do?

- Steve

MVP
MVP

Re: Trigger Date Selection from Selecting Days, Months, Years

Anson

You have not posted your expression, but I suspect that all you need to do is override the other selections using a set expression, something like

     Sum({<Year=,Month=,Day=,Date={some condition}>} Amount)

where some condition selects the past 30 days of data.

Hope that helps

Jonathan

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

Re: Trigger Date Selection from Selecting Days, Months, Years

Hi Jonathan,

Your expression works..   Many Thanks! 

This is my expression. 

avg({<Year=,Month=,Day=,Date={">=$(=addmonths(max(Date),-1))"} >}Sales)

Anson 

Community Browser