Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can I split a month into half ( first half, second half) . I was actually looking for an expression, where I can split my metrics into tiers based on the following criteria
1) usage date <= activation month + 15 days.
2) usage date > activation month + 15 days and usage date <= activation month + 45 days
3) usage data > activation month + 45 days and usage date <= activation month + 75 days
Do you have month field or Date field.
Hi Tyagishaila,
I have date filed for usage and month field for activations.
May be like this:
LOAD [usage date],
[activation month],
If([usage date] - [activation month] <= 15, Dual('Tier 1', 1),
If([usage date] - [activation month] <= 45, Dual('Tier 2', 2),
If([usage date] - [activation month] <= 75, Dual('Tier 3', 3)))) as Tiers
Have you get solution in Sunny T's reply ?
If you want to have a date flag showing first half and second half create a flag in the edit script as
if(Day(Date)<= 15,'First Half','Second Half') as DaysFlag
Also keep in minds months with 30,31,28,29 days in the if condition