Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cumulative dense property lost in subsequent chained measure #728

Open
HuifangYeo opened this issue Dec 12, 2022 · 2 comments
Open

Cumulative dense property lost in subsequent chained measure #728

HuifangYeo opened this issue Dec 12, 2022 · 2 comments
Assignees
Labels
🐛 bug unexpected or wrong behavior

Comments

@HuifangYeo
Copy link
Contributor

HuifangYeo commented Dec 12, 2022

Steps to reproduce

I have a cumulative measure with dense=True.
However, when I create perform fx conversion on the cumulative measure m["Net Cashflow"], I lost the dense property as shown below by m["_convert_flow_to_usd"]:
image

Is this expected? I could overcome this by creating the following:

m["_cumulate_usd"] = tt.agg.sum(
    m["Signed_Amount (USD)"],
    scope=tt.CumulativeScope(level=l[("Time", "Time", "Second")], dense=True),
)

However, I was thinking it would be neater code wise, if I do the following to convert all the measurements to USD using a function:

def to_usd(measure_name):
    usd_name = measure_name + " (USD)"
    m[usd_name] = tt.agg.sum(
        m[measure_name] / m["FX Rate"],
        scope=tt.OriginScope(l["Settlement_Date"], l["Settlement_Currency"]),
    )

    m[usd_name].formatter = "DOUBLE[#,###.00000]"

Environment

  • atoti: 0.7.2
  • Python: 3.9.13
  • Operating system: win32
@HuifangYeo HuifangYeo added the 🐛 bug unexpected or wrong behavior label Dec 12, 2022
@tibdex
Copy link
Member

tibdex commented Dec 12, 2022

Hi Hui Fang, can you share some code to help us reproduce the issue faster (ideally stripped out of anything else but the code required to get to the problematic measure)?

@HuifangYeo
Copy link
Contributor Author

Hi @tibdex,

please see the attached example: intraday-liquidity-cumulative.zip

@HuifangYeo HuifangYeo assigned tibdex and unassigned HuifangYeo Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug unexpected or wrong behavior
Projects
None yet
Development

No branches or pull requests

2 participants