Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a table which displays datas from my database
example :
Nb | Name1 | Name2 | Date1 | Date2 |
---|---|---|---|---|
1 | A1 | B1 | 01/01/2014 | 10:00:00 |
2 | B1 | C1 | 01/03/2014 | 10:00:00 |
3 | C1 | D1 | 02/01/2014 | 10:00:00 |
4 | D1 | Ed | 02/17/2014 | 10: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
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)
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)
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
see attachment, hope it helps
I follow dahtu.qv answer but using 2 variables; also I changed your tablebox with a straight table
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.
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
Hi
If there is no link between the fields, you can't use in "Table box" . Use Straight table for that scenario.