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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
mazacini
Creator III
Creator III

Pivot Table - Include Table 1 Dimensions for Table 2 aggregation even if not present in Table 2

I have ITEMS table with Dimensions CODE and ITEMCODE. I have a SALES table with TRANSDATE, TRANSMTH,TRANSREF, ITEMCODE and LINEVAL.

I have built a Pivot Table which shows total LINEVALUE for CODE per TRANMTH.

But, I want to show for all CODE, even for CODE where there is no record in the SALES table.

Currently in my Pivot Table, only displays CODE where there is a record in the SALES table.

As far as I can tell, I have unchecked the relevant Suppress Zero and Suppres Null.

Help anyone?

22 Replies
Not applicable

uncheck "Suppress zero" is ok.

have you unchecked "Suppress null" on both CODE and TRANMTH ?

Regards

Gilles

mazacini
Creator III
Creator III
Author

Yes (on the Dimensions tab?)

SunilChauhan
Champion II
Champion II


try this

if( isnull(salefield)=0,salefield,0) in Place of sales field in expression

or

if( len(salefield)<>0,salefield,0) in Place of sales field in expression

Sunil Chauhan
mazacini
Creator III
Creator III
Author

Hi

My expression is sum(LINEVAL). So I have replaced "salefield" above with "SUM(LINEVAL)".

The Pivot know shows all the CODES!

Thank you!

You might be able to help me further though! When I apply filters, the report will exclude the CODES not associated to the filter. Is there a way I can extend your solution to overcome this?

For instance, I have a Product Group table that has ITEMCODE and PG. When I filter on a particular PG, it seems to override your solution? Maybe Set Analysis?

Can I ask

SunilChauhan
Champion II
Champion II

i am understand fully but you may reuire linke this

sum({<Filtername={"Filtervalue"}>} if( isnull(salefield)=0,salefield,0)

Sunil Chauhan
mazacini
Creator III
Creator III
Author

Do you mean to include a specific Filtername and Filtervalue?

How would I get this to work for ANY combinations of different filter names and values?

SunilChauhan
Champion II
Champion II

sum( if( isnull(salefield)=0,salefield,0)) this will help u

Sunil Chauhan
mazacini
Creator III
Creator III
Author

Thank you for your help so far.

I think your solution will work, as long as I filter using a field in the ITEMS table. (I have other fields in the table which I do not mention above).

It does not work when I filter using other fields outside the ITEMS table.

Any suggesttions?

PS -  I am using SUM(LINEVAL) in place of "salefield".

Jason_Michaelides
Partner - Master II
Partner - Master II

Can you post an image of your data model?