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

raw mode in query() does not use the default simulation by default #715

Open
bloussou opened this issue Oct 24, 2022 · 2 comments
Open

raw mode in query() does not use the default simulation by default #715

bloussou opened this issue Oct 24, 2022 · 2 comments
Labels
🐛 bug unexpected or wrong behavior

Comments

@bloussou
Copy link
Contributor

bloussou commented Oct 24, 2022

Hello,
I think raw and pretty queries should return the same results. It is not the case when doing a query on a cube with a parameter simulation:

import atoti as tt
import pandas as pd

TUTORIAL_RESOURCES = "python/atoti/atoti/tutorial/data"

session = tt.Session()

sales_table = session.read_csv(
    f"{TUTORIAL_RESOURCES}/sales.csv",
    table_name="Sales",
    keys=["Sale ID"],
)

shops_table = session.read_csv(
    f"{TUTORIAL_RESOURCES}/shops.csv",
    table_name="Shops",
    keys=["Shop ID"],
)

sales_table.join(shops_table, mapping={"Shop": "Shop ID"})

cube = session.create_cube(sales_table)

l, m = cube.levels, cube.measures

country_simulation = cube.create_parameter_simulation(
    "Country simulation",
    measures={"Country parameter": 1.0},
    levels=[l["Country"]],
)

country_simulation += ("France crash", "France", 0.8)

image

workaround:

cube.query(m["Country parameter"], levels=[l["Country"]], filter=l["Country simulation"] == "Base", mode="raw")
@bloussou bloussou added the 🐛 bug unexpected or wrong behavior label Oct 24, 2022
@bloussou bloussou self-assigned this Oct 24, 2022
@bloussou bloussou changed the title raw mode in query() does not use the Base scenario by default raw mode in query() does not use the default simulation by default Oct 24, 2022
@bloussou
Copy link
Contributor Author

My current guess is that it is not using the defaultValues for the Country simulation hierarchy, I don't know yet where I should get this information that is present in the cellset when doing a "standard" mdx query.

@bloussou
Copy link
Contributor Author

Maybe this is not an issue and in gaq queries useres must specify which Country simulation value they want to use

@bloussou bloussou removed their assignment Nov 3, 2022
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

1 participant