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: 
edemerdjieva
Partner - Creator
Partner - Creator

List field with date

Hello,

I need to display a list with the last 30 dates known. Here is an example:

Please select a date
01/03/2018
28/02/2017
...
01/02/2017

So, I have a date dimension and need to limit this to the last 30 days.

I tried using an If structure to limit the results but it doesn't work since all dates available is shown.

=If(Date>=(Date-30),Date)

Thanks for your advise!

8 Replies
Miguel_Angel_Baeyens

If those are 30 dates starting today, then

If(Date >= Today() -30, Date)

Anyway, I would create a flag field or a different field in your calendar table and use this in the frontend.

Check the AsOf table concept: The As-Of Table

tresesco
MVP
MVP

May be this?

=If(Date>=$(=Max(Date))-30,Date)

edemerdjieva
Partner - Creator
Partner - Creator
Author

It doesn't work. All dates are displayed.

edemerdjieva
Partner - Creator
Partner - Creator
Author

Date corresponds to sales dates. It's not just a calendar.

tresesco
MVP
MVP

Are your dates real-dates or texts? Could you post a screen shot?

edemerdjieva
Partner - Creator
Partner - Creator
Author

The dates are texts which is formatted with a Date(Date) function.

Capture.JPG

tresesco
MVP
MVP

Date() is just a formatting function and it can't convert text into a number/real-date value. Rather use Date#() to parse your date values during load. Then the expression shared above should work fine at the UI.

Load

          Date#(yourTextDateField, 'dateformat <how it looks as text>') as Date

krishna_2644
Specialist III
Specialist III

Hi - check out this.

the script uses max function to find out 1st max date,2nd max date etc.

you can change the field names or script, as per your needs.

the same logic applies for your sales date field too.

if you can provide the sample data, it would be good for us to play around with it.

1.PNG