Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
thi_pham
Creator III
Creator III

TOTAL <dimension> work unexpected with autocalendar dimension

Has anyone got the problem with TOTAL <> with an autocalendar dimension?

I have a DateCode dimension (such as: 2018-01-01 : YYYY-MM-DD), a dimension of product (such as: ProductA, ProductB).

I have a fact table with sale of each product in a period of time.

Then, I created a line chart with:

 - Group Dimension is DateCode

 - Line Dimension is Product

 - Measure is: sum(sales) / sum(total <DateCode> sales)

I got a chart with % of sale of each product on total sale of each day. It works perfectly.

 

Then, I modify it to get the same chart with Month/Quarter, but I cannot handle it to work:

This is how I try:

 - Group Dimension: DateCode.autoCalendar.YearMonth

 - Line Dimension is Product

 - Measure is: sum(sales) / sum(total <DateCode.autoCalendar.YearMonth> sales)

What I get is % of sale of Product on whole sale regardless of datecode,month. While I expected to get the % sale of product all total sale of each YearMonth.

Could anyone show me what I did wrong?

Additionally, I tried with some original dimension instead of DateCode, it works as my guest, just with the dimension include autocalendar, the total keywork seems doesn't work.

Thanks so much for any help.

Labels (2)
1 Solution

Accepted Solutions
thi_pham
Creator III
Creator III
Author

Instead of using DateCode.autoCalendar.YearMonth, I manage the dateCode to get YearMonth in the dataloadeditor and use this new field as the dimension (of course in the expression TOtal <newField>) , it works well. Therefore, I think the problem is an issue of autoCalendar

View solution in original post

6 Replies
shiveshsingh
Master
Master

Are you using YearMonth as your dimension too?

How are you expecting to calculate sum(Sales) YearMonth Wise?

thi_pham
Creator III
Creator III
Author

Are you using YearMonth as your dimension too?
-> Yes, as I mentioned, I created new char with:
- Group Dimension: DateCode.autoCalendar.YearMonth
- Line Dimension is Product
- Measure is: sum(sales) / sum(total <DateCode.autoCalendar.YearMonth> sales)
DateCode is replaced respectively by DateCode.autoCalendar.YearMonth
With the measure, I expect to get the % of sale of each product on the total sales of all products each month
shiveshsingh
Master
Master

It looks fine, can you share some sample data to check?

thi_pham
Creator III
Creator III
Author

I attached a dummy data

thi_pham
Creator III
Creator III
Author

Instead of using DateCode.autoCalendar.YearMonth, I manage the dateCode to get YearMonth in the dataloadeditor and use this new field as the dimension (of course in the expression TOtal <newField>) , it works well. Therefore, I think the problem is an issue of autoCalendar

shiveshsingh
Master
Master

Perfect 🙂