hi,
i want to filter โdate/timeโ-range" of a โsliceโ with โsliderโ-Input (numeric value)
e.g. date-range = the last 30 days (slider = 30)
date-range = the last 7 days (slider = 7)
step 1: adding a โvcโ with formula for calulation number of days from โTodayโ
HOUR (TODAY() - DATE([Date/Time])) / 24
table-name: โweightโ
vc-column-name: โdaysโ
no problem!
step 2: generating numbers between 1 - 30 with slider in a separate table (only one row with value of slider-input)
table-name= โselectโ
column-name = โdaysโ
no problem!
step 3:
filtering โsliceโ with โslider-inputโ
setting up โrow-filter-conditionโ of โsliceโ: [weight].[days] >= [select].[days]
this does not work because i cannot select table โ[select].[days].โ for โrow-filter-conditionโ.
how can i achieve this? - many thanks in advance for your help!
Bsed on understanding of your requirement, you may wish to note and try the following
In general, you may wish to avoid naming tables and columns same as those of AppSheet functions. There is table name Select and column name as days. AppSheet has functions SELECT() and DAY(). So a SELECT() on select table with days column would look like SELECT(Select[days], DAY([Date])โฆ)
It can be confusing to debug and at times may throw error as it could clash with Appsheet reserved words. AppSheet is very generous with element name selection and allows most such words, but better to avoid if possible.
So renaming the step 2 table as โSliderInputโ in place of โselectโ and [days] as [SliderDays] ( assumed to be number type column) , you could try the below slice expression
A. If there is just one data row in the โSliderInputโ table
DATE([DATE/TIME] >= TODAY() - ANY( SliderInput[SliderDays])
B. If there are multiple rows in the โSliderInputโ table, say one for each user, you may need to use a SELECT() statement with suitable argument as shown below
DATE([DATE/TIME] >= TODAY() -ANY(SELECT( SliderInput[SliderDays], [[Email]=USEREMAIL()))
The expression may need minor modifications based on your exact requirement. The above will return the rows with dates in the past those many days from today as set on the slider.
Edit: Added any to the second expression.
hello Suvrutt_Gurjar,
i can learn a lot from from your explanation:
a) naming โtablesโ and โcolumnsโ
b) function โany()โ โฆ
i will test it out - thank you so much !!!
You are welcome. Please take a look at ANY() function article just in case you have not
In fact your mention of ANY() reminded me that there was ANY() required in the second suggested expression as well. Have edited the first post accordingly.
User | Count |
---|---|
36 | |
33 | |
27 | |
23 | |
18 |