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: 
Not applicable

Total and filters

Hello!

that is my table:

t1.JPG

I need to obtain the total I've put in field "R_T" as follows:

If(COD=9937199,Sum({<COD={9937199},TIME=>}AD)-vSumT9937302,

if(COD=9937072,Sum({<COD={9937072},TIME=>}IN),Sum({<TIME=>}AD)))


And R:

If(COD=9937199,Sum({<COD={9937199}>}AD)-vSum9937302,

if(COD=9937072,sum(IN),sum(AD)))


My variable:

vSumT9937302=Sum({<COD={9937302},TIME=>}AD)

vSum9937302=Sum({<COD={9937302}>}AD)


In R gets all filters and R_T not take the filter TIME because I want the total always displayed.

The problem is that when a COD  does not have data in TIME, in this case,  COD 9937072 does not have data in TIME "3"  so when I filter TIME 3 does not give the total correctly.

t2.JPG

How I can fix that? I want to see total every time

I attached file. Thanks!!

1 Solution

Accepted Solutions
pokassov
Specialist
Specialist

Hi!

I fixed it. See expression R_T2

View solution in original post

4 Replies
pokassov
Specialist
Specialist

Hi!

I fixed it. See expression R_T2

Not applicable
Author

Hi! thanks!

And if the COD of the variable has the same situation:

v1.JPG

What is the code for the variable vSumT9937302 to show always the total?
Thank you!

pokassov
Specialist
Specialist

As I see we exclude TIME in the Set Analysis. So vSumT9937302 always ignores selection on TIME.

Or I didn't get your question...

Not applicable
Author

You're right! Everything it's ok.

Thank you very much!