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: 
dana
Creator III
Creator III

Aggr in pivot adds a null for dim value

Hi People,

In order to resolve a total issue in average calculation, I use Aggr in my expression:

Sum(Aggr({<Service_Cost_Type = {'Service Parts'}>}
(Sum({<Service_Cost_Type = {'Service Parts'}>} Service_Part_Costs_Monthly)
/
Count({<Service_Cost_Type = {'Service Parts'}>} distinct Period))
,Cust,Part))

But this causes a null value for the Part dim.

dana_0-1684045281309.png

It doesn't happen with the original expression:

Sum({<Service_Cost_Type = {'Service Parts'}>} Service_Part_Costs_Monthly)
/
Count({<Service_Cost_Type = {'Service Parts'}>} distinct Period)

 

I can resolve it using the AGGR expression only when SecondaryDimensionality =0,

but I would like to know what causes the missing dim.

Thanks in advance!

 

Labels (1)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master II
Partner - Master II

Hi, I suspect the Part field may contain blank/null/whitespaces values.

Check null or blank
If(Len(Trim(Part )) = 0, 'IsNullBlank, 'NotNullBlank') as FieldCheck.

The simplest solution in a table might be to suppress zero values.

View solution in original post

2 Replies
BrunPierre
Partner - Master II
Partner - Master II

Hi, I suspect the Part field may contain blank/null/whitespaces values.

Check null or blank
If(Len(Trim(Part )) = 0, 'IsNullBlank, 'NotNullBlank') as FieldCheck.

The simplest solution in a table might be to suppress zero values.

dana
Creator III
Creator III
Author

Hi @BrunPierre ,

Indeed, there was one empty row in my data that caused it.

Thanks so much!