Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
in my Line chart am showing last 3 years of data, 2022 , 2021, 2020 in 3 different lines, within the date range from 2020 to 2022 all the date selections applied are working fine. here my requirement is when I select 2018 as well it should reflect in my line chart. so i want these 3 years of data as default selection when no other data filter is selected and when other data filter is selected it should respond accordingly.
Which expression i have to use in order to achieve the above. please suggest is it possible even
My 3 expressions and dims are :
CY - (2022)
if(Count({< Inflow_Date = {">=$(=Date(Yearstart(Today()),'DD.MM.YYYY')) <=$(=Date(Today(),'DD.MM.YYYY'))"} >}Id) > 0,
Count({< Inflow_Date = {">=$(=Date(Yearstart(Today()),'DD.MM.YYYY')) <=$(=Date(Today(),'DD.MM.YYYY'))"} >}Id))
PY : (2021)
Count({< Inflow_Date = {">=$(=Date(Yearstart(Today(),-1),'DD.MM.YYYY'))<=$(=Date(Yearend(Today(),-1),'DD.MM.YYYY')) "}>}Id)
PPY : 2020
Count({< Inflow_Date = {">=$(=Date(Yearstart(Today(),-2),'DD.MM.YYYY')) <=$(=Date(Yearend(Today(),-2),'DD.MM.YYYY')) "} >}Id)
Dim : Month(Inflow_Date)
Thanks much in advance.
Hi, I think there is no option to hide line as it is in a table, would be nice if they add the option.
So far the closest I think is to chek with if and only return value when the sleected year is lower than 2020, something like:
If(GetSelectedCount(Inflow_Date)>0 and Min(Year(Inflow_Date))<2020, Count({< Inflow_Date = {">=$(=Date(Yearstart(MakeDate($(=Min(Year(Inflow_Date))))),'DD.MM.YYYY')) <=$(=Date(Yearend(MakeDate($(=Min(Year(Inflow_Date))))),'DD.MM.YYYY')) "} >}Id)
It will be shown on legend, I don't know how to hide that
Thanks for the reply. Yes as we don't have the option to hide, any other way to do this.
@sunny_talwar @rwunderlich any other experts please suggest.
Hi, instead of 3 different expressions you can add year as dimension (maybe you also need to create the field in script) and use only one expression, the expression can be:
Count({<YearField+={2020,2021,2022}>}Id)