Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis problem - bar chart to show 3 months worth of data, driven by month selection.

Hello all, I could use some help with a bar chart…

My document has the following:

Field called LOGDATE and a unique identifier called CALLREF.

List box called Month Logged which allows the user to filter the data by month: =monthname(LOGDATE)

Variable (vMaxLogDate) which finds the latest log date based on list box selection: =max(LOGDATE).

Bar chart, details as follows:

Dimension:  =monthname(LOGDATE)

Expression: =count({$<LOGDATE=>}if(LOGDATE>=monthstart(addmonths(vMaxLogDate,-2)),CALLREF))

My bar chart should show the last 3 months of data, depending on any selection from Month Logged:

  • If no Month Logged selection is made then the last 3 months should be displayed – this works.
  • If a selection is made from Month Logged, (June 2011 for example) then the 3 preceding 3 months of data should be returned – June 2011, May 2011 & April 2011, however the expression above will return all months. The expression =count(if(LOGDATE>=monthstart(addmonths(vMaxLogDate,-2)),CALLREF)) will only return the Month Logged value.

Any suggestions?

Thanks in advance, Michael.

1 Solution

Accepted Solutions
Not applicable
Author

I got this working by using the set analysis expression and limiting the number of visible dimension values to 3.

View solution in original post

1 Reply
Not applicable
Author

I got this working by using the set analysis expression and limiting the number of visible dimension values to 3.