Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
date | num |
---|---|
2016/01/01 | 8 |
2016/01/02 | 4 |
2016/01/03 | 5 |
2016/01/04 | 84 |
2016/01/05 | 16 |
2016/01/06 | 8 |
I need to filter the num by date with expression.
1. Get num from 2016/01/02 to 2016/01/04.
2. Get num of 2016/01/05
It's looks easy but I don't know to do.
Any help will be thanks.
You may try (simple):
sum(if(date>=date('2016/01/02') and date<=date('2016/01/04'), num, 0))
or using set analysis (advance):
sum({<date = {">=date('2016/01/02')<=date('2016/01/04')"}>} num)
S.
If you want to display the literals rather than a sum then this should work
=only({<date={'2016/01/05'}>}num)
= concat({<date= {">=('2016/01/02')<=('2016/01/04')"}> } num,',')
Here are some more options
1) =Sum({<date = {"$(='>=' & Date(MakeDate(2016, 1, 2)) & '<=' & Date(MakeDate(2016, 1, 4)))"}>} num)
2) =Sum({<date = {"$(=Date(MakeDate(2016, 1, 5)))"}>} num)
maybe this