Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
radmin5253
Contributor III
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
Master III
Master III

Hi Brian,

may be

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

Regards,

Antonio

View solution in original post

6 Replies
antoniotiman
Master III
Master III

Hi Brian,

may be

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

Regards,

Antonio

radmin5253
Contributor III
Contributor III
Author

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
Master III
Master III

Can You share Your sample data ?

radmin5253
Contributor III
Contributor III
Author

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
Contributor III
Contributor III
Author

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
Master III
Master III

I'm glad to have helped You.

Regards,

Antonio