Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
alec1982
Specialist II
Specialist II

wrong calculations in table chart

hi guys I am using the following script to create a table as below:

tmp:
LOAD
%LeaseKey,
max([Expense Amount]) as MaxExpense
RESIDENT Expense
GROUP BY %LeaseKey;
LEFT JOIN (tmp) LOAD
%LeaseKey,
[Expense Frequency]
RESIDENT Expense;

Result:
LOAD
%LeaseKey,
MaxExpense,
MaxExpense * 12 as [Annuallized Cost]
RESIDENT tmp;

DROP TABLES Expense, tmp;

the result looks like the below when loaded into a table box. and it is correct

%LeaseKey     Max(Expense Amount)     Annual Amount

1                    1000                                     12000

2                    625                                        7500

3                    400                                        4800

When I try to build the same table into a table chart I get wrong nrs(away higher than what's above.)

I am assuming that I should get the same nrs as the table above.

Any suggestions on what's wrong!

Thxs,

1 Solution

Accepted Solutions
alec1982
Specialist II
Specialist II
Author

While loading the table, I am adding another field that is effecting the calculations.

I have removed it and everything is working normally.

Thank you so much for your help.

Alec

View solution in original post

12 Replies
Anonymous
Not applicable

in the result table you are multipling MaxExpense by 12 to get Annual Cost. Not sure how you will get  Annual amount that much low. Can you please give more detail.

alec1982
Specialist II
Specialist II
Author

Hi,

Sorry, I added the wrong cloumn above. it is added corectly to the discussion now.

So as you see the table has the right values and that's what i see inside a table box.

when I try to load the same field inside a Table chart and add the expression as Sum(Annual Amount) I get away higher nrs than this.

Thxs,

Anonymous
Not applicable

can you try max. Here table chart means is that a striaght table or pivot table.

Anonymous
Not applicable

see the attached. Let me know if that helps otherwise please provide me the sample data i can help you with that.

alec1982
Specialist II
Specialist II
Author

Hi,

Thank you for your reply.

The sample above is working correctly, and I have tried to load the table that I have into a new qvw and worked fine.

Now when I try to apply the calculations on the requiered qvw I get the wrong nrs.

Not sure what could effect the calculations.

Any ideas?

Thxs for your help.

Alec

Anonymous
Not applicable

can you let me know what kind of calculations you are applying . what output you need if you send me the sample document i can help you with that.

alec1982
Specialist II
Specialist II
Author

Hi,

I couldent send the sample as the qvw is huge.

as i said above. when I load the table in the script and then create a table box and add the fields in it, everything looks fine.

when I add it into a straight table chart and the expression on it Sum(Annualized Cost) I get away higher values.

Attached is a sample of the table box as I se it on the qvw. I added it to a new qvw and everything worked normally. not sure what could be a reason on this qvw to make the nrs wrong.

Thxs,

Anonymous
Not applicable

attched is the sample application created with the data which you sent me. I used a straight table please have a look at that. if this does not work then you might forgot to implement any filters or set analysis which you are supposed to be doing in the expressions . If you can direcet me on that i can help you with that.

alec1982
Specialist II
Specialist II
Author

Hi,

Thank you for the sample. As I said it is working normally on any other qvw as I have created a sample and looked exactly the same of what you just sent me.

Now when I do the exact same thing on the requiered qvw I get wrong nrs.

Thxs,