Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
sunil-kumar5
Creator II
Creator II

3 month Active Partner

Hi All,

I have a table with column names like Zone, PartnerCode, InstallationDate, LicenseNumber.

We just want to check the activating partners who are actually working and we have granted activation of 1 or more distinct license numbers  on 3 months average.

Definition of Activating Partner: Partner doing Monthly Average Activation of >=1 in the last three months and this would be zone wise. I will choose the year 2020 based on filter but actually wanted to show the data per below in pivot table. Please help me to identify the question mark. Jan And Feb not required as this is specifically for year 2020 or if you can give for Jan and Feb as well that would be nice.

like

ZoneMarchaprilmayJuneJulyAugustSeptemberOctoberNovemberDecember
Zone1??????????
Zone2??????????
Zone3??????????

 

Thanks

 

1 Reply
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @sunil-kumar5 

The first question is whether this flag to say that a partner is active should take into account selections. For instance, if you pick a licence number that is one installation so no one will be able to average >= 1 across three months.

This question dictates whether you are calculating the flag in the load script or front end. I will assume front end.

You need each column of that pivot to be looking at three months, so Mar 20 needs to consider Jan, Feb and Mar 20. The count of installs then needs to be divided by the number of months.

One way of achieving this is to calculate months from all of your Installation Dates in the load script:

[Installation Date],
Date(MonthStart([Installation Date]), 'MMM-YY') as [Installation Month],

You then need to create a subsequent table which has a field, Active Month, that joins to the right Installation Months. So for March you would have:

Active Month       Installation Month           Active Months
Mar-20                    Jan-20                                  1
Mar-20                    Feb-20                                  1
Mar-20                    Mar-20                                  1


This table needs to be built out for all months to the end of the year, and can be produced in a loop.

This will join to the main table. Using Active Month as the dimension of your pivot you can then do something like to get the average installations per month for a rolling three month period:

sum(InstallationCount) / sum([Active Months])

To count partner codes which average greater than 1 you need to use an aggr function.

sum(aggr(if((sum(InstallationCount) / sum([Active Months])) >= 1, 1, 0), PartnerCode))

I think that should give you what you need.

This blog post goes into more detail on linking periods together to get rolling periods:
https://www.quickintelligence.co.uk/qlikview-accumulate-values/

Hope that helps.

Steve