Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
thanhphongle
Creator II
Creator II

calculating two different result from different charts

hello comunity,

I have a qvw.file and need a solution for my problem

if you open the file you will see three straight charts.

i want to mulitply the result of     gew. Zins =110,13%  from straight chart 1 with the result of  durchschn. Kosten from straight 3 and call the result of both "general cost"

after i want to subtract the result of Gesamtkosten. zzgl ZV with the result of general cost and call it "New Cost"

can anyone help me out here?

i am a qvw debutant. i know that a solution would be manipulating the script. but actually i am not an expert in set anaylsis. so if anyone could attached me a solution with some explanations, that would be great!

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

See attached qvw


talk is cheap, supply exceeds demand

View solution in original post

14 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can't reference values in another chart. You'll have to use the same expressions to calculate that value again. To make things easier you can put expressions in variables. You can then use those variables in expressions. That allows you to reuse expressions.

vInvVolumen: sum([Selling price])

vAnteil: $(vInvVolumen)/sum(total [Selling price])

vGesamtkosten: (1+$(vVerzinsungsberechnung))*$(vInvVolumen)

vVerzinsungsberechnung: ...etc

vGewZins: $(vAnteil)*$(vGesamtkosten)/only([Selling price])

Expression gew.Zins: =$(vGewZins)


talk is cheap, supply exceeds demand
thanhphongle
Creator II
Creator II
Author

"You'll have to use the same expressions to calculate that value again"

I tried to reput the expressions from straight chart 1-3 in a new straight chart. but it does not valclulate the correct value. i dont really know y.

so do I have to put the expressions in variables in the script?

thanhphongle
Creator II
Creator II
Author

and if i have to set the expression as variables in script, how can i exactly put it in the script. i m sorry for those detailed question, i m still a beginner.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You don't have to create the variables in the script. You can use the Variable Overview from the Settings menu (ctrl+alt+v).


talk is cheap, supply exceeds demand
thanhphongle
Creator II
Creator II
Author

oh ok, Ill try it and let you know if it works!

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Your third straight table has only two dimensions. The other two have four. You can add those missing dimensions to your third straight table. Then the expressions should calculate the same values.


talk is cheap, supply exceeds demand
thanhphongle
Creator II
Creator II
Author

if i create a new variable , do i have to to select "Input Contraints" -> "Custom" and add there my expression?

because sometimes when i add the expression as value, it disappears.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

No. You don't have to set constraints if you use the Variable Overview dialog from the Settings menu.


talk is cheap, supply exceeds demand
thanhphongle
Creator II
Creator II
Author

"Your third straight table has only two dimensions. The other two have four. You can add those missing dimensions to your third straight table. Then the expressions should calculate the same values."

I attached a qvw file and followed your instructions

if you look at the straight chart 3

[gew.Zins]=110.13%

durchschn. Kosten= 804440 €

i added a new expression called Überzahlung and normally the result should be

Überzahlung=[durchschn. Kosten]*[gew.Zins]= 885929,772

but QV calculates me 12164.17. and thats wrong.