Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 217137

date issue

$
0
0

First of all: Happy 2017


I'm needing help with basic dates concepts:
I have several campaigns that are repeated throughout the year. Each has a start date and a end date.
ex.
Campaign - Date - Flight - Start Date - End Date
Campaign1 - 10/11/2016 1st flight - 10/10/2016 - 11/30/2016
Campaign1 - 10/12/2016 1st flight - 10/10/2016 - 11/30/2016
Campaign1 - 10/13/2016 1st flight - 10/10/2016 - 11/30/2016
Campaign1 - 10/14/2016 1st flight - 10/10/2016 - 11/30/2016
...
Campaign1 - 11/12/2016 2nd flight - 10/11/2016 - 1/3/2017
Campaign1 - 11/13/2016 2nd flight - 10/11/2016 - 1/3/2017
Campaign1 - 11/14/2016 2nd flight - 10/11/2016 - 1/3/2017
Campaign1 - 11/15/2016 2nd flight - 10/11/2016 - 1/3/2017
...
I need 3 things:
A) Calculation of the number of total days of each campaign
B) Calculation of the time elapsed since the beginning of the campaign

C) Compare CPA of the running days with the same number of days as the previous flight. Example: the current flight has been active for 25 days, I need to compare with the first 25 days of the previous flight

 

CPA = IF(fDados[.Conversions] = 0 ; [.Investiment]; DIVIDE([.Investiment];[.Conversions];BLANK()))

 

I created a column for question A)
.daysCol = DATEDIFF (fdados [start_date]; fDados [data_fim]; DAY) +1
Although I bring the correct number, when it comes to applying to a chart I always have to specify that it is a count and not a sum of all the campaigns


I tried to create a measure for Question A)
(DataDate) [d] [COUNTROWS (FILTER (dCalendary; VALUES (fDates [start_date]) <= dCalendar [DataBase] && VALUES (dDate [data_fim])> = dCalendar [DataBase]


But it only works without relationship with the calendar table and gives error when the end date is less than current date.
Do you see another way to do the above?

 


For Question B) I'm having trouble determining the number of days spent, since it always adds values ​​and that's not what I want.
column:
.DataTest = TODAY () - fDates [start_date]. [Day]


Anyway, I'm screwed and I can not mount these basic measures / columns.
Any charitable soul with the answer?

 

Best regards
Eduardo


Viewing all articles
Browse latest Browse all 217137

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>