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: 
hfkchristian
Creator
Creator

Ignore related values

Hi all

In my qlikview-application I have some fields which are related to each other. Like, when I select a value in field A, there are only some possible values in field B and C.


But in one of my charts I need to calculate a sum for ALL values in field C, not just the possible ones. Field A and B are dimensions in the chart, and as expression I calculate the sum of another field D.

The problem is that as long as field A is a dimension, the expression i automatically limited to the possible values of field B and field C. Instead, I want to calculate the sum of D for all values of field C, but still limited to the possible values of field B.

I tried this:

SUM({$} total<A, B> D)

but it doesn't work.

This does not work either:

SUM ({$ <A=, B=P(B), C=>} D)

How can I do this?

1 Solution

Accepted Solutions
hfkchristian
Creator
Creator
Author

The problem is that most of the times I need field C too. It's just in one expression I want to ignore it.

What I really want is to show both in the same chart:

ABSUM(D) unmodifiedSUM(D) with field C ignored
A1B1100+300100+200+300
A1B2150150+50

View solution in original post

13 Replies
swuehl
MVP
MVP

What about

SUM( {1} TOTAL D)

{1} will ignore any selection you've made and TOTAL qualifier the dimension(s).

swuehl
MVP
MVP

Hm, I may misunderstand what you are trying to achieve. Could you upload a small sample or some lines of sample data?

edit: Maybe

SUM( Total<B> D)

?

hfkchristian
Creator
Creator
Author

Here is some example data.

I have a table which defines how the fields are related. Columns B and C are subfields, loaded to QlikView with the subfield function.

ABC
A1B1, B2C2,C3
A2B3C1,C2,C2
A3B2,B3C1,C2

And there is a table with the values of field D

BCD
B1C2100
B1C1200
B2C2150
B2C150
B1C3300
B3C2500

Then in my chart, A and B are dimensions. The result for SUM(D) will be,assuming only the value A1 is selected:

ABSUM(D)
A1B1100+300
A1B2150

The sum(D) values for C1 does not appear in the table, because C1 is not related to A1. Instead, I want this

ABSUM(D)
A1B1100+200+300
A1B2150+50
cesaraccardi
Specialist
Specialist

Hi Christian,

What is the current key to link the first table and the table that contains the field D? If that includes C, can't you just remove it and use field B only?

Kind Regards,

Cesar

hfkchristian
Creator
Creator
Author

The problem is that most of the times I need field C too. It's just in one expression I want to ignore it.

What I really want is to show both in the same chart:

ABSUM(D) unmodifiedSUM(D) with field C ignored
A1B1100+300100+200+300
A1B2150150+50
cesaraccardi
Specialist
Specialist

I have built a sample application using the AGGR() function to manipulate the aggregation of field D. Please have a look and let us know if this is what you are looking for.

hfkchristian
Creator
Creator
Author

Thanks. Your sample is exactly what I like to do. Unfortunately I can't get it to work when I try that expression on my real data. Not sure why.

hfkchristian
Creator
Creator
Author

I tried to print the values of the temporary AGGR table in a textbox to see how it works. I didt it like this:

=concat(aggr( { $<A1=, A2>} num(sum( D),'# ##0'),C),chr(13))

When nothing is selected I get all the values grouped by C as expected. But as soon as I select  A1 or A2 I dont't get all the values anymore. But only the related values. Nothing changes if I move the set expression to the SUM function instead of the AGGR function.

swuehl
MVP
MVP

Are A1 and A2 field names or field values? In your expression, they should be field names.