Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone!
I have an issue with my App. I want to display the revenue of a brand in a specific period selected by the date picker object.
I have selected the period from 1st of January to 22th of January and I display my values (Revenue, Revenue PY, Revenue in same period of PY, etc.).
When I select the brand OFF my Calendar changes:
With this change my value Revenue in the same period of the previous year chages to and I lose the revenue from the 1st of january to the 4th of january.
This is the expression I use to calculate this measure:
sum({<Data={">=$(=Date(AddYears(Min(Data),-1)))<=$(=Date(AddYears(Max(Data),-1)))"},Anno=>} netto)
where:
I hope I've been clear.
How can I solve this issue to reach my goal?
Thanks to those who will answer me!
"In this way I cannot display the revenue from the 1st Jan to the 3th Jan of the previous year, so I cannot compare the revenue of this year with the revenue of the previous year "
Previous period comparison is possible by way of set analysis, it doesn't matter if you do not have data for all the dates of a comparing period
as I mentioned earlier the selections from 1Jan2023-22Jan2023 are in Selected Excluded state, so you can still use them as below
Selected Period
sum({<DT={">=$(=Date(Min({1<DT=$::DT>}DT)))<=$(=Date(Max({1<DT=$::DT>}DT)))"}>}Sale)
Previous Year Period
sum({<DT={">=$(=AddYears(Min({1<DT=$::DT>}DT),-1))<=$(=AddYears(Max({1<DT=$::DT>}DT),-1))"}>}Sale)
replace DT, with your date field name
Hi ,
This is simply because there is ACTUALLY NO DATA for the selected brand "OFF" from 1-4Jan and 21-22 JAn
You can verify this in your dataset, the calendar is simply showing possible dates for the brand selected
Once you remove the Brand Selection, your calendar will show your initial selection of 1- 22nd Jan
The missing dates that were selected initially are simply in "Selected Excluded" state because of the brand selection as there is no data for that brand for those dates
read more here
Hi @vinieme12 , thanks for your answer.
In this way I cannot display the revenue from the 1st Jan to the 3th Jan of the previous year, so I cannot compare the revenue of this year with the revenue of the previous year . I have values of revenue in the PY from the 1st to the 3th Jan.
So, how can I solve my issue?
Thanks 🙏
"In this way I cannot display the revenue from the 1st Jan to the 3th Jan of the previous year, so I cannot compare the revenue of this year with the revenue of the previous year "
Previous period comparison is possible by way of set analysis, it doesn't matter if you do not have data for all the dates of a comparing period
as I mentioned earlier the selections from 1Jan2023-22Jan2023 are in Selected Excluded state, so you can still use them as below
Selected Period
sum({<DT={">=$(=Date(Min({1<DT=$::DT>}DT)))<=$(=Date(Max({1<DT=$::DT>}DT)))"}>}Sale)
Previous Year Period
sum({<DT={">=$(=AddYears(Min({1<DT=$::DT>}DT),-1))<=$(=AddYears(Max({1<DT=$::DT>}DT),-1))"}>}Sale)
replace DT, with your date field name
Great @vinieme12, it looks working! 😃
How can I set also the Date picker object correctly?
I mean, If I select from 1st to 22th Jan I would like that the Date Picker object shows from 1st to 22th ignoring the selected excluded.