Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Chart to display dates in upcoming months

Hi guys,

I'm looking to make a chart that displays dates 'due' within the next 1, 2 and 3 months in a stacked bar chart.

I have a column with various dates in, and I want to pick out the ones that fall within the next 1,2 or 3 months with today as a reference point.

I've tried IF statements (and a COUNT of the amount of dates), but can't seem to make it work.

Thanks!

6 Replies
nilesh_gangurde
Partner - Specialist
Partner - Specialist

if possible please attach the sample qvw.

-Nilesh

Not applicable
Author

Hi Nilesh,

Not possible unfortunately- its just a long list of dd/mm/yyyy dates

Oliver Greenwood

nilesh_gangurde
Partner - Specialist
Partner - Specialist

At Script level you can write the below mentioned code and generate one more field as FLAG.

if(Date(DateField) >=  Date(TOday()) and Date(DateField) <= Date(Addmonths(today(),3)) ,1,0) as FLAG.

and load the data, then write set analysis in the expression to display the data where Flag is 1.

Or you can do it with the set analysis too.

hope this will help.

-Nilesh

Not applicable
Author

Hi Nilesh,

I'm loading this in correctly (as a resident of the main table), however it's only returning 1's.

Do you have any idea where I might be going wrong?

nilesh_gangurde
Partner - Specialist
Partner - Specialist

Please Find Attachment.

Its working properly.

-Nilesh

kiranmanoharrode
Creator III
Creator III

Hi Oliver

Try below expression,

=if(Date(TOday())>Date(TOday()+1) , Date(Today()) <= Month(Date(Addmonths(today(),3))))

Regards

Kiran Rode

+91 8976977897