Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

boonhaw_tan
New Contributor III

Bar chart show latest 3 months sales if no selection

Hi All,

I need to build to bar chart show sales by month.

There is a requirement to show latest 3 months of sales if no selection.

Also it need to display sales based on user selection.

Really appreciate for any advice.

e.g:

- If no selection, display sales for 201707, 201708 & 201709

- Display sales for 201701 & 201708, if user select 201701 & 201708  

YYYYMMSales
201701100
201702200
201703300
201704100
201705200
201706300
201707400
201708500
201709600

Thanks,

Boon Haw

1 Solution

Accepted Solutions
Highlighted
antoniotiman
Honored Contributor III

Re: Bar chart show latest 3 months sales if no selection

Hi,

Dimension : YYYYMM

Expression :

If(GetSelectedCount(YYYYMM)=0,Sum({<YYYYMM={">=$(=Max(YYYYMM,3))"}>} Sales),Sum(Sales))

Regards,

Antonio

2 Replies
Highlighted
antoniotiman
Honored Contributor III

Re: Bar chart show latest 3 months sales if no selection

Hi,

Dimension : YYYYMM

Expression :

If(GetSelectedCount(YYYYMM)=0,Sum({<YYYYMM={">=$(=Max(YYYYMM,3))"}>} Sales),Sum(Sales))

Regards,

Antonio

boonhaw_tan
New Contributor III

Re: Bar chart show latest 3 months sales if no selection

Thank you so much for response and it work well