Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set analysis or ?

Need help with something.Please find attached

Notice the current year and the months(2nd quarter) selected but the the total recoveries includes the 1st quarter ie Jan,Feb and Mar and also the previous years.

Now i would want to separate the recoveries into previous years and the 1st quater

1 Reply
renjithpl
Specialist
Specialist

Try something like this

You can create a calendar with Quarters using,

  DayNumberOfQuarter in your load statement, then in the set you can use that field to get max Quarter or previous Quarter.

 

// for Max Month recovery
Sum( {<Year=, Month =, MONTH_NAME = {"$(=MonthName(max(MONTH_NAME)))"} >} Recoveries)

// for max Year recovery
Sum( {<YEAR=, Month =, YEAR = {"$(=(max(YEAR)))"} >} >} Recoveries)

//for prev month recovery


sum({<YEAR=,
Month =,
MONTH_NAME = {"$(=MonthName(AddMonths(max(MONTH_NAME), -12)))"}
>} Recovery)

// for Last Year recovery
Sum( {<YEAR=,
Month =,
YEAR = {"$(=(max(YEAR)-1))"}
>} Recoveries)

regards

Ren