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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Simple (?) table calculation

ABC
JAN
Machine2162,5
264,4
Cons.4,1

Hi

I have a table as above and i would like to pick out the value from Cons. for JAN.

I have tried like this: sum(if(A='Machine' and B='Cons.',C)) but i only get 0 as result (should be 4,1).

What am i doing wrong?

Bets regards

/Mats

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

First of all you have to create the data as shown below then you can use your expression

sum(if(A='Machine' and B='Cons.',C))


otherwise it would not give proper results .

You have merged cells in Field A,

Qlikview do not consider merged cells as one , it evaluates them as different cells so only first cell will have value and others So you have to populate them first.

A

BC
JAN
Machine 12162,5
Machine 1264,4
Machine 1Cons.4,1
Machine 221119,3
Machine 3266,3
Machine 4Cons.6,3
Machine 32145,5
Machine 4264
Machine 5Cons.3,6

View solution in original post

6 Replies
Not applicable
Author

hi

try this

sum(if(B='cons.',C))

kumarnatarajan
Partner - Specialist
Partner - Specialist

Hi,

Try below Syntex

Ex: Only({$<B={"Cons."},A={"Machine 2"}>}C)

MK_QSL
MVP
MVP

Can you provide more specific table data?

luis_pimentel
Partner - Creator III
Partner - Creator III

What values have the rows 2 and 3 for A? If they are blanck or null, try sum(if(B='cons.',C))

If their value is "Machine", your expression sum(if(A='Machine' and B='Cons.',C)) should work.

Regards.

Luis.

Not applicable
Author

Ok, i did not tell all of it, sorry. In Column A i have several Machines, like this:

ABC
JAN
Machine 12162,5
264,4
Cons.4,1
Machine 221119,3
266,3
Cons.6,3
Machine 32145,5
264
Cons.3,6

I want to for example pick out the value of Cons. for JAN only for machine 2

/Mats

Anonymous
Not applicable
Author

First of all you have to create the data as shown below then you can use your expression

sum(if(A='Machine' and B='Cons.',C))


otherwise it would not give proper results .

You have merged cells in Field A,

Qlikview do not consider merged cells as one , it evaluates them as different cells so only first cell will have value and others So you have to populate them first.

A

BC
JAN
Machine 12162,5
Machine 1264,4
Machine 1Cons.4,1
Machine 221119,3
Machine 3266,3
Machine 4Cons.6,3
Machine 32145,5
Machine 4264
Machine 5Cons.3,6