Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
vipingarg23
Creator
Creator

Expression total is giving wrong value

Hi All,

When I am calculating the percentage of red marked column by expression total, it is giving me the wrong data. Can anybody help me ?

11 Replies
sunny_talwar

What is your expression? What all are your dimensions? and what is the expected output?

vipingarg23
Creator
Creator
Author

Expression is (column1/column2) and expected output that I am looking for, is - (Sum(Column1)/Sum(Column2))*100 means percentage.

and there are lots of dimensions.

sunny_talwar

Hahahaha your response didn't really answer any of my question in a way that I can offer help.... Anyways, would you be able to share a sample?

vipingarg23
Creator
Creator
Author

Capture.JPG

Here A,B,C are expressions and I am calculating the Value of A and B from other fields. And calculating the value of C through formula - B/A. Now when I am doing expression total for all expression A,B,C, I am getting the right value of A,B but I am not getting the right value of C where I am calculating the percent. So I am expecting output Sum(B)/Sum(A)*100 means - 194/247*100=78.54%....I am getting the value 194,247 but not 78.54..It is giving me something else.

neha_shirsath
Specialist
Specialist

If you are using straight table then go to expression tab and check for Expression total.

vipingarg23
Creator
Creator
Author

Yes, I am using straight table and doing the same but it is not working.

vinieme12
Champion III
Champion III

There is a difference between Expression TOTAL and Sum of ROWS

try this sample data

LOAD * INLINE [

    DIM, C1, C2

    A, 10, -10

    B, 15, -60

    C, 17, 12

    D, 26, -13

    E, 65, 10

];

Create a straight table with All 3 fields in dimensions

2 same Expressions i.e.   =C1 /C2

Expression 1 to have : Expression TOTAL

Expression 2 to have  Sum of ROWS

This should help you understand the difference

Look at the TOTAL mode section, Bottom right hand side

TOTALS.PNG

TOTALS2.PNG

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
sonkumamon
Creator
Creator

I don't understand, do you want to total row to sum all the percentage values in the field or do you want it to present the Sum of field 1 divided by the sum of field 2?

Maybe you can give a more clear presentation of your data?

vinieme12
Champion III
Champion III

please post your app!

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.