Stack Exchange
log in
users (11)
rooms (10)
faq
f.ivy
general
recent
conversations
Discussion between samkart and f.ivy
Imported from a comment discussion on
stackoverflow.com/questi...
f.ivy
Sep 1, 2022 13:56
and this is wrong because the currency we are looking for this example is the one with 2011-05-01
f.ivy
Sep 1, 2022 13:56
if we have for example a currency for a date: 2011-05-24, two currencies dates: 2011-06-01 and 2011-05-01, the datediff will pickup the date with few days to 2011-05-24, which is 2011-06-01
f.ivy
Sep 1, 2022 13:54
datediff in pyspark returns different in days between two days
f.ivy
Sep 1, 2022 13:53
There is a problem in the reasoning of the datediff
f.ivy
Sep 1, 2022 13:53
Hello Samkart
f.ivy
Aug 25, 2022 15:57
i just got the error i made
f.ivy
Aug 25, 2022 15:57
Your code was correct
f.ivy
Aug 25, 2022 14:22
something like : withcolumn('converted_value', func.when(curr_from == 'EUR', 'value_to_convert').otherwise(conversion formula)
f.ivy
Aug 25, 2022 14:19
why don't we use another way of doing this logique
f.ivy
Aug 25, 2022 14:19
There is no problem with the data for this id
f.ivy
Aug 25, 2022 14:11
am checking the data for 0013425466
f.ivy
Aug 25, 2022 14:06
what does coalesce do?
f.ivy
Aug 25, 2022 14:05
yes it doesnt
f.ivy
Aug 25, 2022 14:03
like me
f.ivy
Aug 25, 2022 14:03
why you not getting duplicates
f.ivy
Aug 25, 2022 14:01
with when. otherwise
f.ivy
Aug 25, 2022 14:01
what if we change the coeslcse
f.ivy
Aug 25, 2022 14:00
i got the same problem
f.ivy
Aug 25, 2022 13:58
i will try it
f.ivy
Aug 25, 2022 13:57
0019374142 and 0019374530
f.ivy
Aug 25, 2022 13:57
yes but notice that the purchase_id is different
f.ivy
Aug 25, 2022 13:56
if value to convert is 199.50 the converted value should remain 199.50
f.ivy
Aug 25, 2022 13:54
but it took another amount
f.ivy
Aug 25, 2022 13:54
since it's from EUR to EUR
f.ivy
Aug 25, 2022 13:54
yes it has two records, but as you see the converted value should remain the same
f.ivy
Aug 25, 2022 13:54
wait i will check
f.ivy
Aug 25, 2022 13:52
You there?
f.ivy
Aug 25, 2022 13:49
5 0013425466 EUR EUR 00030 2018-12-03 199.50 null null 22.500000000000
f.ivy
Aug 25, 2022 13:48
4 0013425466 EUR EUR 00030 2018-12-03 199.50 null null 199.500000000000
f.ivy
Aug 25, 2022 13:48
for id: 0013425466, converted values are duplicated and reversed for some
f.ivy
Aug 25, 2022 13:47
U can check now
f.ivy
Aug 25, 2022 13:38
ok
f.ivy
Aug 25, 2022 13:38
for the EUR case
f.ivy
Aug 25, 2022 13:38
this is what am getting
f.ivy
Aug 25, 2022 13:38
i will deleted it after
f.ivy
Aug 25, 2022 13:38
Look at my post again i added the screen shot there
f.ivy
Aug 25, 2022 13:35
did you check my last df1 and df2
f.ivy
Aug 25, 2022 13:35
maybe because i don't have all privilèges
f.ivy
Aug 25, 2022 13:34
i don't have it hahaha
f.ivy
Aug 25, 2022 13:34
but i'm not getting this
f.ivy
Aug 25, 2022 13:34
This is the output am looking for
f.ivy
Aug 25, 2022 13:33
I dont have it never mind
f.ivy
Aug 25, 2022 13:30
shot
f.ivy
Aug 25, 2022 13:30
how can i send yo screen sot ?
f.ivy
Aug 25, 2022 13:29
and 'dt' is from df1
f.ivy
Aug 25, 2022 13:29
but in the 3rd line you using over(wd?partionnedBy('from_curr','dt')
f.ivy
Aug 25, 2022 13:27
from_curr_start_dt?
f.ivy
Aug 25, 2022 13:24
net_amount_in_transaction_currency = value_to_convert
f.ivy
Aug 25, 2022 13:24
currency_rates_exchange =df2
f.ivy
Aug 25, 2022 13:24
purchase_order_item = df1