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: 
PA5
Contributor II
Contributor II

Last 4 quarters graph with regular filters

Hi All,

I'm writing a formula for a bar graph which should show the current and last 3 quarters by default. But when the user selects Year, Quarter or Month from filters then the filters should function like normal.

I'm trying a formula which is not giving me any result, please let me know what I am doing wrong here.

 

    Count(

        Distinct

        {<

            prod_status_tm = {'Promoted'},

            call_date = {

                =If(

                    IsNull(GetFieldSelections([created_date.autoCalendar.Year])) and

                    IsNull(GetFieldSelections([created_date.autoCalendar.Quarter])),

                    '>=$(=Date(AddMonths(Today(), -12), ''MM/DD/YYYY''))<=$(=Date(Today(), ''MM/DD/YYYY''))',

                    '$(=GetFieldSelections([created_date.autoCalendar.Year]))',

                    '$(=GetFieldSelections([created_date.autoCalendar.Quarter]))'

                )

            }

        >}

        case_nmbr

    ),

    '#,##0'  // Format as a thousands separator

)

Labels (5)
2 Replies
PA5
Contributor II
Contributor II
Author

Can someone please help with this query

marcus_sommer

You may try something like this (reduced to the essential part of the question):

count({< Q *= {">=$(=max(Q)-4)"}>} case_nmbr)

whereby Q is a continuous quarter-counter created within the calendar with something like:

Year * 4 + Quarter as Q