Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Arianna1
Contributor II
Contributor II

Filter field

Hello world,
I would be happy if you could help me with the following request:  
From a field of date (see Example: 01/09/2020, 02/09/2020, ecc), I would build a filter where the
choices are: month, week, day.
Thanks in advance for an possible answer.

Arianna

Labels (4)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

In the Recipes section of QlikCookbook, download the "Date Grouping" example. There you'll find scripting to assign named ranges to your dates. 

2020-10-18_09-15-27.png

 

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

View solution in original post

6 Replies
Taoufiq_Zarra

@Arianna1 

are you looking for

Month(Date)

Year(Date)

Week(Date)

Day(Date)

 ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Arianna1
Contributor II
Contributor II
Author

Hi Taoufiq,

thanks for the reply but the functions you are talking about, for example Month(Date) used in a filter, it will have the choices: january, february, march, april, ecc. 

I would build a filter with the choices: month, week, day.😀

Matthewli
Contributor
Contributor

I'm making a project schedule for our construction company.

I would like to be able to have a filter that only shows "Start Date" that is equal to this week or this month.

Is that possible?

Vegar
MVP
MVP

As the same date can be associated with both year, month, week and day you need to create a new table that holds these connections.

 You could do something like this. Adjust it to your data model and needs. 

Periods:
Load
Date,
'today' as Period
From SourceContainingDates
Where
Date= today() ;

Concatenate (Periods) Load
Date,
'WTD' as Period
From SourceContainingDates
Where
inWeekToDate ([Date] , today() , 0);

Concatenate (Periods) Load
Date,
'MTD' as Period
From SourceContainingDates
Where
inMonthToDate ([Date] , today() , 0);

Concatenate (Periods) Load
Date,
'YTD' as Period
From SourceContainingDates
Where
inyeartodate ([Date] , today() , 0);

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

In the Recipes section of QlikCookbook, download the "Date Grouping" example. There you'll find scripting to assign named ranges to your dates. 

2020-10-18_09-15-27.png

 

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

Arianna1
Contributor II
Contributor II
Author

Thank you all but  Rwunderlich this is exactly what I was looking for.

Thank you. Have a good day