Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Filter a table object with a calendar

Hi,

I have a table which displays datas from my database

example :

NbName1Name2Date1Date2
1A1B101/01/201410:00:00
2B1C101/03/201410:00:00
3C1D102/01/201410:00:00
4D1Ed02/17/201410:00:00

Now I have a field CalDate which is a calendar (several dates) created in Script.

I have added a slider/calendar field on my sheet to display CalDate and I want that on selection of a date, my table only displays datas where Date1 >= CalDate - 7 (and Date 1 <= CalDate)

As it's not a chart, I cannot use something like :

= (sum({$ <[Date 1]={">=$(=Date(CalDate - 7))"}>} Target ))

So how can I do it ?

Thanks in advance for your reply

1 Solution

Accepted Solutions
Not applicable
Author

If the CalDate field is not connected to data model then find the below method.

1. Create the slider object with CalDate.

2. Create a variable having the selected the CalDate value. LET vSelectedDate = Max(CalDate) ;

3. Use the below expression in your straight table:

          SUM({<[Date 1]={"<=$(vSelectedDate)>=($(vSelectedDate)-7)"}>} Target)

View solution in original post

6 Replies
Not applicable
Author

If the CalDate field is not connected to data model then find the below method.

1. Create the slider object with CalDate.

2. Create a variable having the selected the CalDate value. LET vSelectedDate = Max(CalDate) ;

3. Use the below expression in your straight table:

          SUM({<[Date 1]={"<=$(vSelectedDate)>=($(vSelectedDate)-7)"}>} Target)

Not applicable
Author

I'm sorry but either I'm doing it wrong or my problem isn't clear enough.

See the document in attachment, I have dates in myTable and I want to filter the table according to the field CalDate (in calendar I prefer, or in cursor if necesary) selected.

Thank you for your help

maxgro
MVP
MVP

see attachment, hope it helps

I follow dahtu.qv answer but using 2 variables; also I changed your tablebox with a straight table

Not applicable
Author

Firstly, Your data model is wrong, You need to make connection b/n Calender Table & MyTable with DateID.

In Mytable, Rename the Num(Date) AS DateID. so these two table got connected and if you make any selection CalDate, those date selection will effect on the MyTable data.

Not applicable
Author

Thank you for your answers. I didn't want to connect these 2 fields because there's no link between them. I just wanted to know if there is a way to filter a tablebox (not a straight table) by selecting a date from a calendar... As it may not have this option, I had chosen to follow the pattern of the straight table of Massimo.

Thank you again

MayilVahanan

Hi

If there is no link between the fields, you can't use in "Table box" . Use Straight table for that scenario.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.