Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
kvrqliks
Contributor II
Contributor II

calculating previous 6 months trend and show in the line graph

I have the following tables

ReportingVersion

Reporting DatecobDate
01-Aug-202001-Jun-2020
01-Aug-202001-Jul-2020
01-Aug-202001-Aug-2020
01-Sep-202001-Jul-2020
01-Sep-202001-Aug-2020
01-Sep-202001-Sep-2020

 

CobDateDetails

cobDateDeptStatusAmount
01-Jun-2020Dept1PASS1000
01-Jun-2020Dept2FAIL2000
01-Jun-2020Dept3PASS1500
01-Jul-2020Dept1PASS2000
01-Jul-2020Dept2PASS1000
01-Jul-2020Dept3PASS2500
01-Aug-2020Dept1PASS1500
01-Aug-2020Dept2FAIL2000
01-Aug-2020Dept3PASS1500
01-Sep-2020Dept1PASS500
01-Sep-2020Dept2FAIL700
01-Sep-2020Dept3PASS1500

 

The user would be making a reporting version selection . Based on the selection i want previous 2 months rolling to be calculated and shown (i.e)

If the user chooses 01-Sep-2020 as the version i want the result to be

Reporting DatecobDateAmountComments
01-Sep-202001-Jul-202010000Should sum Jun + Jul
01-Sep-202001-Aug-202010500Should Sum Jul + Aug
01-Sep-202001-Sep-20207700Should sum Aug + Sep

 

for 01-Aug-2020 it would be 

Reporting DatecobDateAmountComments
01-Aug-202001-Jun-20204500would be only sum june data
01-Aug-202001-Jul-202010000Should sum Jun + Jul
01-Aug-202001-Aug-202010500Should Sum Jul + Aug

 

Can someone please let me know how to achieve this functionality . 

2 Solutions

Accepted Solutions
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @kvrqliks 

You should be able to achieve this by creating a separate table that links the right reporting dates to the correct cobDates.

I think you need another field, say cobGroup to use as the dimension, then link cobGroup to the right cobDates, so each cobGroup would link to two cobDates. The Reporting Date would then link to the correct cobGroups, so you're just adding another level to the joins you currently have.

This blog post talks about aggregating values in that way:
https://www.quickintelligence.co.uk/qlikview-accumulate-values/

Hope that helps.

Steve

View solution in original post

kvrqliks
Contributor II
Contributor II
Author

thanks Steve. This really helped . Apologies for the delay 

View solution in original post

2 Replies
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @kvrqliks 

You should be able to achieve this by creating a separate table that links the right reporting dates to the correct cobDates.

I think you need another field, say cobGroup to use as the dimension, then link cobGroup to the right cobDates, so each cobGroup would link to two cobDates. The Reporting Date would then link to the correct cobGroups, so you're just adding another level to the joins you currently have.

This blog post talks about aggregating values in that way:
https://www.quickintelligence.co.uk/qlikview-accumulate-values/

Hope that helps.

Steve

kvrqliks
Contributor II
Contributor II
Author

thanks Steve. This really helped . Apologies for the delay