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

Aggr Count doesn't work

Hello,

I am trying  to check if there is only empty values in a straight table or there is at least 1 value

Example:

IDViewer
1 
1Person1
1 
2 
2 
2 

Empty cell is '' not null

So with the example data above, when I select to add a Viewer column to table, I would expect to see:

IDViewer
1Person1
2 

 

for the viewer table I use this calculated dimenstion:

 

=if(aggr(count(distinct [Viewer]),[ID])=1,[Viewer],
if([Viewer]='',Null(),[Viewer]))

 

For my test the formula above works perfectly as it should,  but then I add it to my dynamic table, where other things are checked as well, it doesn't work at all:

 

=if(WildMatch(GetFieldSelections(DetailDim_, ','),'*Approver*Editor*Viewer*'),
if([Approver]='' and [Editor]='' and [Viewer]='',Null(),[Viewer]),

if(WildMatch(GetFieldSelections(DetailDim_, ','),'*Editor*Viewer*'),
if([Editor]='' and [Viewer]='',Null(),[Viewer]),

if(WildMatch(GetFieldSelections(DetailDim_, ','),'*Approver*Viewer*'),
if([Approver]='' and [Viewer]='',Null(),[Viewer]),

if(aggr(count(distinct [Viewer]),[ID])=1,[Viewer],
if([Viewer]='',Null(),[Viewer])))))

 

So far what I have noticed its the WildMatch and/or GetFieldSelections that is messing it up. Once I add the Aggr part under true or false, it doesn't show the empty cases for the IDs.

 

Additional info for the table we have.
In Straight Table we have checked 'Suppress when Value is null' and Enable Conditional:

 

=substringcount('|'&GetFieldSelections(DetailDim_, '|', 100)&'|','Viewer')

 

1 Solution

Accepted Solutions
Kunkulis
Creator
Creator
Author

Not sure why it didn't work at the first place, but rather then using GetFieldSelections I opted for GetCurrentSelections.

View solution in original post

1 Reply
Kunkulis
Creator
Creator
Author

Not sure why it didn't work at the first place, but rather then using GetFieldSelections I opted for GetCurrentSelections.