Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Comparing current values with historic audit values

Hi All,

I have two tables - one contains the current values of a table of projects and the second is an audit table which contains an entry each time a field is change.

Based on these two tables, I need to be able to answer the following types of questions:

  • Show all of the projects that had their stage changed to Execute between xx date and xx date
  • Show all of the projects that were created this week, this month or between two dates
  • Show the previous value of xx field on xx project
  • Show when xx field was last changed or display no change

Help please!

Thanks,

A

T1_Current_Project_Table
ProjectProject NameProject ManagerStart DateFinish DateStageCreated
P1AlphaFreddy01/01/201326/04/2014Initiate01/12/2012
P2BravoEoin02/01/201327/04/2014Plan02/12/2012
P3CharlieDaisy03/01/201328/04/2014Execute03/12/2012
P4DeltaCharlie04/01/201329/04/2014Design04/12/2012
P5EchoBetty05/01/201330/04/2014Test05/12/2012
P6FoxtrotAdam06/01/201301/05/2014Initiate06/12/2012

T2_Project_Table_Audit
Column ChangedChanged ByChanged OnProjectOld ValueNew Value
Project ManagerA.N. Other19/01/2013 03:14P3DoraDaisy
StageJoe01/02/2013 08:17P4InitiatePlan
StageJoe10/04/2013 08:17P4PlanExecute
2 Replies
Gysbert_Wassenaar

  • Show all of the projects that had their stage changed to Execute between xx date and xx date
    Two helper variables to hold the start and end date for the search: vStartPeriod, vEndPeriod
    Dimension: Project, Project Name
    Expression: sum({<[Old Value]-={'Execute'},[New Value]={'Execute'},[Changed On]={'>=$(vStartPeriod)<=$(vEndPeriod)'}>}1)
    Notes:
    you can hide the expression in a straight table so only the projects are shown
    make sure the [Changed On] dates are numeric dates, not strings.

  • Show all of the projects that were created this week, this month or between two dates
    Dimension: Project, Project Name
    expression:
    this week: sum({<[Created]={'>=$(=today()-6)<=$(=today())'}>1)
    this month: sum({<[Created]={'>=$(=monthstart(today())<=$(=today())'}>1)
    between two dates: sum({<[Created]={'>=$(vStartPeriod)<=$(vEndPeriod)'}>1)
    Notes:
    Create and use other variables if you want to keep this independant of the change-to-execute chart

  • Show the previous value of xx field on xx project
    Dimension: Project, Project Name, [Column Changed]
    expression: firstsortedvalue([Old Value], -[Changed On])

  • Show when xx field was last changed or display no change
    Dimension: Project, Project Name, [Column Changed]
    expression: max([Changed On])
    Notes:
    If there is no record for a field for a product in the audit table it's not possible to show that field. Or you first have to make sure that you created records for all fields for all projects in the audit table

talk is cheap, supply exceeds demand
bill_mtc
Partner - Creator
Partner - Creator

Nice, that's the power of set analysis! Kudos.