Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everybody: I have a little question, i dont know what function or what to do in this case.
I have to calculate a quantity. I have a lapse of time this is a difference between when something is ordered and delivered. This is final date - initial date. For example 1 day or 5 days or 20. In the graphic i have to divide the quantity in the numbers of the diference . I dont know how to do this with the number of days.
1 - 15, 15-30, etc
Sory for my poor english, i´ll put the needed graphic.
In the dimension i´ve put =DAY(DATE((FechaFin - Fecha), 'YY/MM/DD')) . I see the dates, but i´d like to group them.
Hi Jeremias - the function is dynamic. The 60+ bracket will automatically show as 60-75. If you have values over 75 those will be in new classes.
To avoid that use an IF() like this
IF ( [Final Date] - [Start Date] < 60, Class( [Final Date] - [Start Date] , 15) , '60+')
Hi there,
i suggest using the class() function with your Final Date - Initial Date to create the dimension.
Class ( [Final Date] - [Start Date] , 15)
In this example 15 is the range for each bucket. This will create 'buckets' (like country, person etc...) within which your expression will breakdown into.
Looking at the chart, your expression would be just something like this: sum(Quantity)
maybe class?
see attachment
=Class(FechaFin-Fecha, 15)
as dimension
Thank you. Can i stop with the buckets in 60 for example?
I mean 0 - 15, 15-30, 30-45, 45-60 and 60+
Thank you. Can i stop with the buckets in 60 for example?
I mean 0 - 15, 15-30, 30-45, 45-60 and 60+
Hi Jeremias - the function is dynamic. The 60+ bracket will automatically show as 60-75. If you have values over 75 those will be in new classes.
To avoid that use an IF() like this
IF ( [Final Date] - [Start Date] < 60, Class( [Final Date] - [Start Date] , 15) , '60+')
Yeah, that works. Thank you.
Only a last question. How i change the 0 <= x < 15 to '0 to 15'
Cheers
sure you can purge the <>= signs and replace x with 'to' as follows;
IF ( [Final Date] - [Start Date] < 60, PurgeChar( Class( [Final Date] - [Start Date] , 15,'to'),'>=<') , '60+')
Thank you! Sory i have two more little questions.
I have negative values in the dates, i think that is an error in the data and that´s not my problem but i don´t wanna show this. How can i hide this values ? i have -15 - 0 . And i have values "-" i think they are nulls. How can i hide this values too?