Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello.
I'm trying to get a grand total of two fields in a chart expression but it will not return the right amount.(dimension is Yearweek)
Field1 is the latest exchange rate
Field2 is row price
I want the expression to first calculate field1 multiplied by field2, and then return the total amount of the calculated value for each week showing up in the chart. I have tried this expression but it returns the wrong value.
=sum(Field1*Field2)
Please help me with the right expression!
Patric
Hi! Depending on how your data is structured in tables behind, you probably need to use som kind of AGGR-expression, over the dimension YearWeek Check that out and try.
Good luck,
Anders
The data is like this:
Yearweek Field1 Field2
201202 8,85 1000
201202 8,85 2000
201203 1,00 500
201203 8,85 1500
201204 1,00 1000
I need to show this in a bar chart with dimension Yearweek.
And the value i want to show is the total value of field1*field2 for each week.
(above Yearweek 201202 should show the value 26550)
Patric
Did it solve your problem?
Yes and No.
I did another Join load in the script then the original expression worked(=sum(Field1*Field2)..
So you were right in your first answer, so i checked my tablestructure and did some change.
But i have another one for you!!
I need to count the rows of a field, but only the rows thats not 0.
How do i write that expression??
Patric
Hi!
Do you mean in a straight table chart or in the database? Please give more info to explain the problem.
Hi.
When i use this expression: count([Totradpris]) in a stright table chart, Qlikview will count all the rows in that table with a value in field Totradpris.
But i want it only to count the rows in Totradpris where Totradpris is not 0.
count(Totradpris) where Totradpris<>0
Patric
try Count({$<Totradpris -= {0}>}Totradpris) (a minus sign followed by an equal to sign)
Hi Jasleen!
I tried your expression but i could not get i to work.
but then a chang the expression to this: =count(Totradpris)-count({$<Totradpris={'0,00'}>}Totradpris) then it worked fine.
Thank you for the help!
Patric