Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
scarr1980
Contributor II
Contributor II

Previous 2 Months Value

Hello,

I'm new to Qlikview and have looked at other solutions on the forum but cannot find one that works for my data and would appreciate some guidance towards a solution.

At this stage all that I am trying to accomplish is to append the previous 2 months data as 2 new calculated dimensions/expressions to the table. 

I have the following example dataset (which continues on over months as per the AsAtDate column):

 What I have:

KPI TitleKPI NumberReporting FreqLocationTarget/EA YTDResult YTD% Var YTDAsAtDate
% of Facebook leads convertedMH1MDublin90%90.8%0.93%01/01/2018
% of Facebook leads convertedMH1MLondon90%91.5%1.69%01/01/2018
% of Facebook leads convertedMH1MNew York90%99.7%10.81%01/01/2018
% of Facebook leads convertedMH1MTokyo90%95.8%6.39%01/01/2018
% of instagram ebook signupsMH2MDublin75%91.8%22.37%01/01/2018
% of instagram ebook signupsMH2MLondon75%70.6%-5.88%01/01/2018
% of instagram ebook signupsMH2MNew York75%61.0%-18.69%01/01/2018
% of instagram ebook signupsMH2MTokyo75%53.8%-28.33%01/01/2018

 

What I would like to achieve:

KPI TitleKPI NumberReporting FreqLocationTarget/EA YTDResult YTD% Var YTDAsAtDateCurrent (-2)Current (-1)
% of Facebook leads convertedMH1MDublin90%90.8%0.93%01/01/201892.7%94.1%
1 Solution

Accepted Solutions
chrismarlow
Specialist II
Specialist II

Hi,

I would be inclined to set 3 variables, with the prior months calculated from the first;

20190624_1.png

Then use set analysis to pick out the months in the expressions (I've just shown the three values for simplicity);

20190624_2.png

Note my dates are DD/MM/YYYY - I think this approach would work if you are on different settings, but if it does not work would be the first thing I checked.

Cheers,

Chris. 

View solution in original post

5 Replies
chrismarlow
Specialist II
Specialist II

Hi,

I would be inclined to set 3 variables, with the prior months calculated from the first;

20190624_1.png

Then use set analysis to pick out the months in the expressions (I've just shown the three values for simplicity);

20190624_2.png

Note my dates are DD/MM/YYYY - I think this approach would work if you are on different settings, but if it does not work would be the first thing I checked.

Cheers,

Chris. 

scarr1980
Contributor II
Contributor II
Author

Hi Chris,

Thanks for the reply. What you posted was very helpful and has helped me move a bit further along.

I still have a couple of queries:

In your tables -your 'Target /EA YTD' is only applied once =- mine is coming in on every line. Why would that be?

I have created the Variables and used them in the expressions you outlined but in my Straight Table the result from the expression is being applied on a new line rather than on the same line as desired.

Thanks again for the help I'm still trying to mentally wrap my head around the mechanics of it all.

 

chrismarlow
Specialist II
Specialist II

Hi,

I think that is because you have more dimensions than me;

20160627_1.png

I would add the other columns in as expressions - eg only({<AsAtDate={'$(vCurrent)'}>}[Target/EA YTD]) as [Target/EA YTD] etc.

But this is going to limit you to showing 1 month - if you want to show more than one month (on a row basis) with history in columns will need to do something different.

Cheers,

Chris.

scarr1980
Contributor II
Contributor II
Author

Hi Chris,

Thanks again and I hope it didn't hurt when you fell from heaven.

Seriously though, much appreciated. Thats given me enough for now to move it forward a little.

I'm sure I'll be back with another thread begging for help in now time.

 

 

chrismarlow
Specialist II
Specialist II

No worries - glad to help get you going in the right direction.