You can create a calendar with dimensions: day, week and month. Then you can create 3 charts, each one with sales vs each dimension. And make a show conditional (properties->layout) for them, that
chart 1 -if difference between start and end date <15,
chart 2 -if difference between start and end date >15 and < 30,
chart 3 -if difference between start and end date >30,
Thank you for the prompt response. Here the current dimension is the visit_date ie. the date on which the customer purchased a product. But I want to change it according to the filters applied ie start and end date which themselves don't have a variable assigned to them. That's why I failed to execute what you suggested. Could you throw some more light on how to approach it?
Create two variables first:
Let MaxDate = Max(date);
Let MinDate = Min(date);
Then, in the condition for each dimension (ie, your day, week, month dimensions)
Day - $(MaxDate)-$(MinDate)<30
Week - $(MaxDate)-$(MinDate)>30 and $(MaxDate)-$(MinDate)<90
Month - $(MaxDate)-$(MinDate)>90
Syntax and logic may not be quite there, but I hope this gives you enough to get this working for you.
You could try transform start date and end date into num and compare those differences, I don't know for sure how 15 day and 30 days differences are represented in num form, but you can check those differences in a text box, then put those in the 'if' statements that I suggested.
Or you can try, use the day function and create a logic to compare the differences between days, but I think this way is a bit more difficult because not all the months have 30 days exactly.