Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
reporting_neu
Creator III
Creator III

Diagram - Dimension - Date from today and next 30 days

Hello, I want to have the date as a dimension in my diagram.
The date should start from today and show the next 30 days.
This is not a problem with the key figures. Somehow I can't manage one dimension.

The field is called '% Date'.

I've tried several times. But without success.

=date((today(),+30)%Datum)

If you want, you are welcome to answer in German.

I hope you can help me.

Labels (2)
1 Solution

Accepted Solutions
reporting_neu
Creator III
Creator III
Author

I found the solution. I can enter this formula in the dimension:

=if([%datum]>Today()+30,'',if([%datum]<Today(),'',date([%datum])))

View solution in original post

6 Replies
brunobertels
Master
Master

Hello 

Does your futur date exist in your master calendar ? 

If not , then first use this expression for your max date expression in your mastercalendar you may find somethink like this : 

max(%Datum)+30 as MaxDate

 

Then as expression for your dimension use this 

if(%Datum >=today(), %Datum)

reporting_neu
Creator III
Creator III
Author

Thank you for your answer.

The future date exists in a table. But it should be independent of the master calendar.

For example, there are dates of January 15th to  March 31th. I want that in the diagram, in the dimension, the date = today () and today () + 30 is taken.

The result would then be January 15th to around February 15th.

brunobertels
Master
Master

Hi 

In your diagram 

Put as dimension your date field %Datum 

then as expression use set analysis 

Sum({$<%Datum={">=$(=today())<=$(=today()+30)"}>}sales)

 

Or with calculated dimension 

dimension = 

aggr(Only({$<%Datum={">=today()<=today()+30"}>}%Datum),%Datum)

and as mesure your actual mesure 

 

hope it helps 

reporting_neu
Creator III
Creator III
Author

Thank you for your help.

The second date is not resolved in the expression. It looks like this:

Sum({$<%datum={">=20.11.2020<=44185)"}>}sale)

It cannot resolve the "-30" as a date. Not even if I write a "date" beforehand.


The formula you specified is outputting the correct values, but the date is no longer displayed. For example, only "-" appears in a table.

reporting_neu
Creator III
Creator III
Author

Could you test the formula on your own?

=Sum({<%datum={">=$(=Date(today(),'MM.DD.YYYY'))<=$(=date(addMonths(today(1),1),'MM.DD.YYYY'))"}>}sales)

Although the formula looks correct, it does not work and shows the entire period before today.

reporting_neu
Creator III
Creator III
Author

I found the solution. I can enter this formula in the dimension:

=if([%datum]>Today()+30,'',if([%datum]<Today(),'',date([%datum])))