Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a query, I want to compare the sales for a current year with sales 10 days prior to current year
Here in the below image when user selects an event , corresponding date for that particular event and corresponding days for comparison
for eg as shown in below image users select event as Diwali, date as 10/10/2018
no of days for comparison =9
so Date selected for comparing is calculated based on following
Date selected by user(10/10/2018 )- no of days for comparison (9) so 'Date selected for comparison '=1/10/2018
so now I have to compare between the given range last year date ie 1/10/2018 and current year date 10/10/2018,
so this is working fine only if I am selecting no of days for comparison as 1,2,3,4,5,6,7,8,9 but if I am selecting no of comparison days as 10 then its not working because here date selected for comparison will be 30/09/2018 so this means here the month will be changed .
use the below set analysis in your expression
lets say your date field is datefield and v_days contain the no of days
{<datefield={"<=$(=max(datefield)) >=$(adddays(max(datefield),-$(v_days)))"}>}
You mean this?
=sum({< Sold_Date = {"<=$(=max(Sold_date)) >=$(adddays(max(Sold_date),-$(compday)))"}>} quantity_sold)
sum({< Sold_Date = {">=$(=max(Date))<=$(=Date(max(date)-vNo))"} >} quantity_sold)
- sum({< Sold_Date = {">=$(=max(Date))<=$(=Date(max(date)-vNo))"} >}quantity_returns)
where vNO is the number of days entered.
Hi,
I am using following expression but its giving me no result
sum({< Sold_Date = {">=$(=max(Date))<=$(=Date(max(date)- compday)"} >} quantity_sold)
- sum({< Sold_Date = {">=$(=max(Date))<=$(=Date(max(date)- compday)"} >}quantity_returns)
sum({< Sold_Date = {"<=$(=max(Date))>=$(=Date(max(date)- compday)"} >} quantity_sold) - sum({< Sold_Date = {"<=$(=max(Date))>=$(=Date(max(date)- compday)"} >}quantity_returns)
you and @shiveshsingh have written >= max date and <= maxdate-10 which is not what you want. ..Try the above. i have altered it.
now I have tried what you said still not working
sum({< Sold_Date = {"<=$(=max(lastDate))>=$(=Date(max(lastDate)- compday)"} >} quantity_sold)
- sum({< Sold_Date = {"<=$(=max(lastDate))>=$(=Date(max(lastDate)- compday)"} >}quantity_returns)
Here lastDate is labelled(caption ) as Date in list box
what do you see when you use =compday in a text box
and what do you see when you use =$(Date(max(lastDate)- compday) in a text box.
use thsi
Date(max(lastDate)- compday)
select the event please , then see