Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all, I have a list box that contains year/quarter but I only need to show the most recent 7 quarters.
2021 Q3
2021 Q2
2021 Q1
2020 Q4
2020 Q3
2020 Q2
2020 Q1 --
2019 Q4
2019 Q3
2019 Q2
2019 Q1
2018 Q4
2018 Q3
2018 Q2
2018 Q1
if you want top 7 based on your selections, you can use a calculated dimension in your filter object.
=aggr(if(rank([Year Quarter Field]) <= 7, [Year Quarter Field]) ,[Year Quarter Field])
Otherwise you can create a flag (or another field entirely but that may be confusing on front end with conflicting selections) in your data model and use that in your filter object.
Example:
load script flag:
data:
load * inline [
field
1
6
4
3
2
]
;
left join (data)
load field, 1 as is_top_2 resident data
where rowno() <2
order by field desc
;
=if(is_top_2= 1, [field])
if you want top 7 based on your selections, you can use a calculated dimension in your filter object.
=aggr(if(rank([Year Quarter Field]) <= 7, [Year Quarter Field]) ,[Year Quarter Field])
Otherwise you can create a flag (or another field entirely but that may be confusing on front end with conflicting selections) in your data model and use that in your filter object.
Example:
load script flag:
data:
load * inline [
field
1
6
4
3
2
]
;
left join (data)
load field, 1 as is_top_2 resident data
where rowno() <2
order by field desc
;
=if(is_top_2= 1, [field])