Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi.
i need to create an filter, like if user enter 01-01-2022 to 02-02-2022, so all sales between this date should be show.
or someone plz talk me what expression i need to wright to get sale between. i.e. 02-02-2022 to 03-05-2022.
As below
=Sum({<Datefield={">=$(=Date(Min(Datefield)))<=$(=Date(Max(Datefield)))"}>}Sales)
one option is to create a filter where you allow the user to select all the date fields by dragging the mouse across the date filter. that is your simplest option and you dont need to add anything to your filter.
if on the other hand you want the user to type the date range, you need to make sure that the user follows a predefined format. to answer your question directly, you can then parse the entered date range. use subfield to get the first and second dates - you can parse the date range using space. save the 1st and 2nd dates into two variables and use those variables in your set analysis:
sum({<[your date field]={">=$(vDate1)<={vDate2}"}>}metricField)
you need to make sure the date formats are consistent.
the issue with this is that you need to build logic to anticipate different styles of entering the date range, what errors are anticipated.
look at this function:
I create Day Month Year fields and use in variable, and use this set expression but filter pane not accepting.
sir i wanna create an filter pane, and in that filter if user type in search like i.e 01-02-2022 to 20-03-2022 so it should show all sales or data between this date, if is possible so plz talk me how can i achieve.