Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Expression field has Missing data

Hello! 

I hope someone can help me on this.  I have a pivot table  that looks like below when exported to excel.  My goal for this report is to send the Actual %  Share to every vendor.   When I clear the vendor selections and selecting only the FY, and FQ and Material, there are missing  data (in ?) on the last 3 columns ...Is there something that's missing in my formula.?. If I select a certain vendor, the data are correct.... the empty cells are now correctly filled.

Pls. see table below with its formula.

Thank you in advance.

   

TypeCalendarMaterialTotal Shipments For All  VendorVendor% ShareShipQtyTargetVarianceActual % Share
AQ3-201670-2333511682A0.45,2974,67362445%
AQ3-201670-2333511682B0.33,181???
AQ3-201670-2333511682C0.33,204???
AQ3-201669-2333610000A0.54,0005,000-1,00040%
AQ3-201669-2333610000B0.56,000???
AQ3-201680-233566000A0.73,0004,200-1,20050%
AQ3-201680-233566000B0.33,000???
Formula
Total Shipments For All  Vendor  (calculated dimension)

=Aggr(Sum({<Vendor=>}ShipQty),Material,Calendar)

Note :  I'm trying to get the sum of ship qty per Material per calendar FY and FQ..  I placed Vendor= on the formula because I don't want to change the value on the Target, Variance and % share when a certain vendor is selected.

ShipQty=sum(ShipQty)
Target=Aggr(Sum({<Vendor=>}ShipQty),Material,Calendar)* sum([&% Share])  or  Total Shipments for all Vendor * [% Share]
Variance[ShipQty] - [Target (Qty)]
Actual % Share=sum(ShipQty) / Aggr(Sum({<Vendor=>}ShipQty),Material,Calendar) or  ShipQty / Total Shipments for All Vendor

 

1 Solution

Accepted Solutions
swuehl
MVP
MVP

It would be easier to help with a small sample file to work with.

If you want to try with the NODISTINCT qualifier:

=Sum({<Vendor=>} Aggr(NODISTINCT Sum({<Vendor=>}ShipQty),Material,Calendar))* sum([&% Share])

[not sure about the Sum() as outer aggregation function]

Or if you want to try with adding Vendor to the dimension list:

=Sum({<Vendor=>}Aggr(Sum({<Vendor=>}ShipQty),Material,Calendar,Vendor))* sum([&% Share])

or maybe

=Sum({<Vendor=>} TOTAL<Material,Calendar> Aggr(Sum({<Vendor=>}ShipQty),Material,Calendar,Vendor))* sum([&% Share])

View solution in original post

4 Replies
swuehl
MVP
MVP

I think you get a grain mismatch here in your advanced aggregation (and you should also consider using an outer aggregation function).

See

Pitfalls of the Aggr function

You could try with adding a NODISTINCT qualifier to the aggr() functions (and then please chose also an appropriate outer aggregation function), though I am not sure if this delivers the correct output (mostly because you have not mentioned what you expect to see).

Or try adding Vendor to the dimensions of the aggr() function.

Anonymous
Not applicable
Author

Hi!  Swuehl,

,Pls. see below expected output.... if you could share me the formula adding the non distinct, it would be much appreciated...I'm not really good in advanced and complicated  formula particularly on aggr and non distinct function.

tks.

   

TypeCalendarMaterialTotal Shipments For All  VendorVendor% ShareShipQtyTargetVarianceActual % Share
AQ3-201670-2333511682A0.45,2974,67362445%
AQ3-201670-2333511682B0.33,1813,505-32427%
AQ3-201670-2333511682C0.33,2043,505-30127%
swuehl
MVP
MVP

It would be easier to help with a small sample file to work with.

If you want to try with the NODISTINCT qualifier:

=Sum({<Vendor=>} Aggr(NODISTINCT Sum({<Vendor=>}ShipQty),Material,Calendar))* sum([&% Share])

[not sure about the Sum() as outer aggregation function]

Or if you want to try with adding Vendor to the dimension list:

=Sum({<Vendor=>}Aggr(Sum({<Vendor=>}ShipQty),Material,Calendar,Vendor))* sum([&% Share])

or maybe

=Sum({<Vendor=>} TOTAL<Material,Calendar> Aggr(Sum({<Vendor=>}ShipQty),Material,Calendar,Vendor))* sum([&% Share])

Anonymous
Not applicable
Author

Swuehl.

The third one worked...

=Sum({<Vendor=>} TOTAL<Material,Calendar> Aggr(Sum({<Vendor=>}ShipQty),Material,Calendar,Vendor))* sum([&% Share])

Thank you so much,,,