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: 
Not applicable

expression for accumulated years

Hello Everyone,

I am a newbie to QlikView. I have requirement to calculate value based on certain criteria.

below is the input table in the QlikView

primaryTable.JPG

conditions: 

for each month in the same year

if(Jan) -> sum of RiskCategory weights in Jan of the same year

if(Feb) --> sum of RiskCategory weights in Jan and Feb of the same year

if(March)-- > sum of RiskCategory weights from Jan to March  of the same year

if(April) --> sum of RiskCategory weights from Jan to April  of the same year

.

.

.

if(Dec) --> sum of RiskCategory weights from January to December  of the same year

**if multiple RiskCategories existed for any month we should take one occurrence of risk category which is having maximum risk weight

For example if we want to calculate riskweight for the month of November in 2016 then we should consider the below rows only

     

IDMonthYearRiskCategoryRiskWeight

XYZOctober2016Cardiovascular0.6491st occurrence
XYZOctober2016Pulmonary0.3411st occurrence
XYZNovember2016Cardiovascular0.6492nd occurrence
XYZNovember2016Diabetes type 20.666
XYZNovember2016Psychiatric0.798
XYZNovember2016Pulmonary1.0372nd occurrence
XYZNovember2016Renal1.896

** since I do not have data from January to September in 2016 i have considered only October and November data for November month calculation

now the result should be (0.649 for Cardiovascular+ 1.037 for Pulmonary + 0.666 for Diabetes type 2 + 0.798 for Psychiatric + 1.896 for Renal ) + constant value of 0.536  = 5.582


and the  result table should be

finalTable.JPG

Please let me know if this is possible through the expression and help me to solve the logic

PS: there multiple ID's will be existed in the table

0 Replies