Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Good day!..
can anyone help me? I am looking for multiplete buckets with same date in Dimesnsion
Like -
Last Week (0-7 days)
Last week -1 (7-14 days)
Last Month (0-30 days)
Last Month -1 (30-60 days)
Please help on this.
thasnks
Hi Sir,
Thank you for the reaply, but I have a filed in my data set which contans date (let say daty wise sale). Now i want to show Last week, last week -1 ,current month, Last month sale.
Please suggest.
Try this in Script
Sample:
Load * Inline [
DateField, Sales
Today(), 10
Today()-1, 20
Today()-2, 30
Today()-3, 40
Today()-4, 50
];
Cale:
Load DateField, Sales, Week(DateField) as Week, Month(DateField) as Month,
If(Week = Max(Week-1), Dual('Last Week',1),
If(Week = Max(Week-2), Dual('Last Week - 1',2),
If(Month = Max(Month), Dual('Current Month',3),
If(Month = Max(Month-1), Dual('Last Month Sale',4))))) as [Dates Buckets]
Resident Sample;
Drop Table Sample;
The link above has a line of code
IntervalMatch ([start_date])
[start_date] - this is the field of "Date". You have insert to the script in the link proposed a code snippet, replacing [start_date] on your field name of date. Further on the list you must create a listbox and use it in the field [Date Range].
When you load the script in the variable v_today writes the current date. Selections are performed in the list. The desired ranges of selections you can add or change the code.
Regards,
Andrey