Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculate with two as of date figures


hi,

   I have a scenario where i need to compute for a value extracted from two different date snapshots.

   

  ex:

    Table 1

    No of Enrolled students (as of Jan 2012) - 45

    No of Enrolled students (as of Jan 2013) - 65

    No of Enrolled students (as of Jan 2014) - 75

    Table 2

     No of Enrolled students who enrolled in 2012 - 45

     No of Enrolled students who enrolled in 2013 - 20

     No of Enrolled students who enrolled in 2014 - 10

    Formula:

    2014 figures = (No of Enrolled students who enrolled in 2014 *  No of Enrolled students (as of Jan 2013)) /

                             No of Enrolled students (as of Jan 2012)

   Really appreaciate your help on this.

   Many thanks!

5 Replies
Not applicable
Author

hi,

Can u upload your sample data data ??

amit_saini
Master III
Master III

Ronald,

As Vivek suggested please share your sample data.

Thanks,
AS

Anonymous
Not applicable
Author

hi,

  thanks for the reply, unfortunately im not allowed to disclose any data even sample..

  Is there a way to use the sample tables i listed?

  use it in the command syntax,,, many thanks!

Not applicable
Author

Hi,

I have used this script for your given data

Table1:

Load MonthName(Month) as Month,Student1 Inline [

Month,Student1

01/01/2012,45

01/01/2013,65

01/01/2014,75 ];

Inner Join

Table2:

Load MonthName(Month) as Month,Student2 Inline [

Month,Student2

01/01/2012,45

01/01/2013,20

01/01/2014,10 ];

Load Month as Month1,

     (Student2 * Previous(Student1))/Previous(Previous(Student1)) As Figures

     Resident Table1;

It giving figures for only 2014 , because for others years value is null

I am also attaching the sample QVW application

!Regards,

Vivek

Anonymous
Not applicable
Author

many thanks viveck for this.

The situation is we are using an existing model which is already verified... and they dont allow us to modify any part of it..

so in that model,, they store the value of No of enrolled as of date.

Per day they create one record for the enrollment figure to capture the snapshot..

then in the dashboard, they will ask the user to select the "as of date ".

In this situation is it possible...

when the user already selected one as of date... e.x. Jan 2014 and the entire dashboard is already filtered with this,

then i create a calculation

      No of enrolled (As of Jan 2014) + No of Enrolled (as of Jan 2013) ???

  Many thanks for the help.