Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello,
I have the below requirement:
Date1 : 2017-01-25
Date2: 2017-03-21
I have to calculate the no of months from the above 2 dates: The output should be upto 2 decimal places like 1.86 and not 2. I used the below logic in tmpa:
Load_data.Subscription_Cancelled!=null?TalendDate.diffDate(Load_data.Subscription_Cancelled,Load_data.Subscription_Created,"MM"):0.00
but the result i get with this diffdate function is a integer number and not exact 2 decimal value. Is it possible to get this result in any other way or using some other function?
i have used the the below query:
select
Subscription_id,
customer_id,
subscriptionsource,
active_flag,
subscriptioncreated_at,
subscriptiondeleted_at,
subscription_brand,
initialorders_id,
initial_shipping_country_id,
shipping_country_id,
rank() over ( partition by customer_id order by subscriptioncreated_at ) Rank,
rank() over ( partition by customer_id,subscription_brand
order by subscriptioncreated_at ) Rank1,
round(months_between(subscriptiondeleted_at,subscriptioncreated_at),2) cancelled_subscription_not_null,
round(months_between(getdate(),subscriptioncreated_at),2) cancelled_subscription_null
from "+context.Redshift_Schema_DM+".dim_subscription
the round function gives accurate results. BUt i get a warning message in the tDBinput component as "Parameter(query): schema is different for the query". Although i have defined 14 columns in my Edit schema which is same as no of columns in SQL query.
How to get RID of this warning? the job runs fine and gives correct result. Its just that this job shows up this warning message.