Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
G
Good day !
I have one chart which is "Sales overview by Period" , and I want it to show the current year , which is from 202301 - 202312. But there is one "open" (yellow color) postpone to "202510" , but I only want this chart to show from 202301 - 202312, do you have any script advise to remove 202510 ?
this is my current script for "Open" as above.
Kindly help for this.
Thanks in advance !!
add below criteria to your existing expression
Datefield={">=$(=Date(YearStart( today() ),'YYYY-MM-DD'))<=$(=Date(YearEnd( today() ),'YYYY-MM-DD'))"}
replace Datefield with the actual datefield name in your datamodel
replace YYYY-MM-DD with the date format as in your date field
G'day @kiansin, I have a different method to achieve this type of outcome.
I create a flag in the load script on each row of data, something like this:
Sales:
load SaleDate
, if( year( SaleDate ) = 2023, 1, 0 ) as CurYear
, Amount
resident SaleTable;
Then in the chart, I would have an expression like this:
sum( {$<CurYear = {1}>} Amount )
I hope this helps.
Cheers, Barnaby.