Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

radmin5253
New Contributor III

Trying to exclude the current month from a line chart

I have been struggling with trying to exclude the current month from a line chart if I use this it works fine but it is hard coded and I want to do this dynamically so I do not have to update the chart every month.

Sum({$<Date={'<=8/31/2017'}>}AvgSessionDuration*Sessions)/3600

However if I try something along these lines it does not seem to work, I know I am missing something simple

Sum({$<Date={'<=Inmonth(Date,today(),-1)'}>}AvgSessionDuration*Sessions)/3600

Any help would be much appreciated

1 Solution

Accepted Solutions
antoniotiman
Honored Contributor III

Re: Trying to exclude the current month from a line chart

Hi Brian,

may be

Sum({$<Date={'<=$(=MonthEnd(Today(),-1))'}>} AvgSessionDuration*Sessions)/3600

Regards,

Antonio

6 Replies
antoniotiman
Honored Contributor III

Re: Trying to exclude the current month from a line chart

Hi Brian,

may be

Sum({$<Date={'<=$(=MonthEnd(Today(),-1))'}>} AvgSessionDuration*Sessions)/3600

Regards,

Antonio

radmin5253
New Contributor III

Re: Trying to exclude the current month from a line chart

No it does not display any data same as the one I posted, I know the problem lies in this area '<=Inmonth(Date,today(),-1)' of the expression but I just can not figure it out. MonthEnd was a good try though. If I could just figure out how to automate this little piece '<=8/31/2017'

If I change your expression to Sum({$<Date={'<=$(MonthEnd(Today(),-1))'}>} AvgSessionDuration*Sessions)/3600 it displays data but does not exclude the month of September (I removed the = in front of MonthEnd)

I appreciate the help Antonio been working on this for about a week and my boss just does not like the partial month showing in his reports he briefs

antoniotiman
Honored Contributor III

Re: Trying to exclude the current month from a line chart

Can You share Your sample data ?

radmin5253
New Contributor III

Re: Trying to exclude the current month from a line chart

Sure how do I do that?

I need to run to do an errand but will be back if it helps I can attach the application.

radmin5253
New Contributor III

Re: Trying to exclude the current month from a line chart

Antonio thanks for your help something in your post made me look closer at date formatting and your original worked when I tweaked it as follows for my instance

Sum({$<Date={'<=$(=Date(MonthEnd(Today(),-1),'M/D/YYYY'))'}>} AvgSessionDuration*Sessions)/3600

I had two different date formats so my choice was to reformat one of the two conflicting formats or change to a number in this case I chose to change the format.

antoniotiman
Honored Contributor III

Re: Trying to exclude the current month from a line chart

I'm glad to have helped You.

Regards,

Antonio

Community Browser