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

display data all based when condition met(column value = some value)

I'm trying to display the top 20 when user click on show top n else display all records based on condition met(column value = some value)

Attached is what I tried but logic is not working ..any insight would greatly be appreciated.

1 Solution

Accepted Solutions
sunny_talwar

Try this

=Aggr(
	If(vAtt = 1,
		If(Rank(Only({<[column  2] = {0}, [Column 1]>} [Column 1])) <= 20, Only({<[column  2] = {0}, [Column 1]>} [Column 1])),
		Only({<[column  2] = {0}, [Column 1]>} [Column 1])
	)
, [Column 1])

View solution in original post

3 Replies
sunny_talwar

Try this

=Aggr(
	If(vAtt = 1,
		If(Rank(Only({<[column  2] = {0}, [Column 1]>} [Column 1])) <= 20, Only({<[column  2] = {0}, [Column 1]>} [Column 1])),
		Only({<[column  2] = {0}, [Column 1]>} [Column 1])
	)
, [Column 1])
Sai78
Contributor III
Contributor III
Author

I tried to implement a similar approach to another condition, but I get an error in the expression,, could you check on below condition where I made a mistake or if any other way I can write this logic. (This expression has' and' and 'OR ' values ) 

=Aggr(
If(vPtNdAtt = 1,
If(Rank(
Only(( Status='Missing 'and DateType='CaseCreatedDate' )
OR ( [Case Type] = 'test' and testdate >='$(vToday)'and testdate<='$(v30Days)')
OR ([Case Type] = 'test2' and test2date >='$(vToday)'and test2date<='$(v30Days)' )
OR ([claims] = '0'),[Identifier]), [Identifier])) <= 20,
Only(( Status='Missing 'and DateType='CaseCreatedDate' )
OR ( [Case Type] = 'test' and testdate >='$(vToday)'and testdate<='$(v30Days)')
OR ([Case Type] = 'test2' and test2date >='$(vToday)'and test2date<='$(v30Days)' )
OR ([claims] = '0'),[Identifier]),[Identifier])),
Only(( Status='Missing 'and DateType='CaseCreatedDate' )
OR ( [Case Type] = 'test' and testdate >='$(vToday)'and testdate<='$(v30Days)')
OR ([Case Type] = 'test2' and test2date >='$(vToday)'and test2date<='$(v30Days)' )
OR ([claims] = '0'),[Identifier]), [Identifier])
), [Identifier])

Sai78
Contributor III
Contributor III
Author

Hi Sunny,

Could you please help me to add the OR condition to the above logic. I have a requirement to pull the data based on multiple conditions ..I tried below but not getting desired results..could you please help?

 

 

=Aggr(
If(vPtNdAtt = 1,
If(Rank(
Only(( Status='Missing 'and DateType='CaseCreatedDate' )
OR ( [Case Type] = 'test' and testdate >='$(vToday)'and testdate<='$(v30Days)')
OR ([Case Type] = 'test2' and test2date >='$(vToday)'and test2date<='$(v30Days)' )
OR ([claims] = '0'),[Identifier]), [Identifier])) <= 20,
Only(( Status='Missing 'and DateType='CaseCreatedDate' )
OR ( [Case Type] = 'test' and testdate >='$(vToday)'and testdate<='$(v30Days)')
OR ([Case Type] = 'test2' and test2date >='$(vToday)'and test2date<='$(v30Days)' )
OR ([claims] = '0'),[Identifier]),[Identifier])),
Only(( Status='Missing 'and DateType='CaseCreatedDate' )
OR ( [Case Type] = 'test' and testdate >='$(vToday)'and testdate<='$(v30Days)')
OR ([Case Type] = 'test2' and test2date >='$(vToday)'and test2date<='$(v30Days)' )
OR ([claims] = '0'),[Identifier]), [Identifier])
), [Identifier])