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

ERROR Internal Cubes error (ExpressionError): Unknown attribute 'u'date1_item' #469

Open
ashutoshgaurav opened this issue Mar 12, 2019 · 1 comment

Comments

@ashutoshgaurav
Copy link

i am trying to create a fresh cube based on hello_world example. but i am not able to get how to make changes in model.json file in aggrgate and measures categories. if want genrate a column with a difference of two columns then this shows an error like this
ERROR Internal Cubes error (ExpressionError): Unknown attribute 'u'date1_item'
please help.

my json file is:
"cubes": [
{
"name": "node_balance",
"dimensions": ["item", "year_item"],
**"measures": [
{"name":"duration", "label":"Duration",
"expression": "date1_item - date2_item"}

        ],
        "aggregates": [
            ],**
        "mappings": {
                      "item.line_item": "line_item",
                      "item.subcategory": "subcategory",
                      "item.subcategory_label": "subcategory_label",
                      "item.category": "category",
                      "item.cpu_item": "cpu_item",
                      "item.category_label": "category_label",
                      "item.year_item": "year_item",
                      "item.date1_item": "date1_item",
                      "item.date2_item": "date2_item"
                     },
        "info": {
            "min_date": "2010-01-01",
            "max_date": "2010-12-31"
        }
    }
@ThamaluM
Copy link

Hi @ashutoshgaurav according to my experience with cubes expressions in measures contains other measures not attributes. In your expression date1_item and date2_item are not defined as measures. (Cubes do not directly get data from relevant column in fact table. You have to define two another measures for them.)

"measures": [ {"name":"date1_item"}, {"name":"date2_item"}, {"name":"duration", "label":"Duration", "expression": "date1_item - `date2_item"} ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants