Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

anutosh_dhar
Contributor

set analysis

i am new in qv.

i want to do set analysis operation.

1)i have done database cloud.

2)in the cloud actualamount and budgetamount are present.

3)i want to show budget cost,actual cost,margin(budget/actual -1) for the seletd year as well as previous year in the same bar graph.

1 Solution

Accepted Solutions

Re: set analysis

Hi,

You need to create the variable with values as below

vT should have value of =Max(YearFieldName) which gets the selected year

vT1 should have value of =Max(YearFieldName)-1 which gets the previous year

YearFieldName should be dimension.

Expression for the budget cost for current year and previous year

=Sum({<YearFieldName={$(=vT),$(=vT1)}>} budgetCost) for budget cost

=Sum({<YearFieldName={$(=vT),$(=vT1)}>} actualCost) for actual cost

=Sum({<YearFieldName={$(=vT),$(=vT1)}>} budgetCost)/Sum({<YearFieldName={$(=vT),$(=vT1)}>} actualCost) - 1 for margin

8 Replies

Re: set analysis

Hi

     Use like this

           =Sum({<Year = {$(vT)}>}budget cost) Where vT = max(Year)

          =Sum({<Year = {$(vT1)}>}budget cost) Where vT1 = max(Year)-1

     Hope it helps

anutosh_dhar
Contributor

Re: set analysis

thanks for your reply.

i have followed your instruction-

please let me know whether is the following steps is ok or not

1)created two variables a)vT(for current year)  b)vT1(prev year),

2)created two more variables two holding this

=Sum({<Year = {$(vT)}>}budget cost) Where vT = max(Year)

=Sum({<Year = {$(vT1)}>}budget cost) Where vT1 = max(Year)-1

3)from the barchart select those variable name.

Re: set analysis

Hi

     Can you explain third point? Not sure, what is that?

     Use no dimension or Year as dimension

anutosh_dhar
Contributor

Re: set analysis

i am talking about expression.

should i map all those variable into the expression?

Re: set analysis

Hi

     Yes, Use both expression ..

    

     1st: =Sum({<Year = {$(vT)}>}budget cost)

     2nd: =Sum({<Year = {$(vT1)}>}budget cost)

     Hope it helps

Re: set analysis

Hi,

You need to create the variable with values as below

vT should have value of =Max(YearFieldName) which gets the selected year

vT1 should have value of =Max(YearFieldName)-1 which gets the previous year

YearFieldName should be dimension.

Expression for the budget cost for current year and previous year

=Sum({<YearFieldName={$(=vT),$(=vT1)}>} budgetCost) for budget cost

=Sum({<YearFieldName={$(=vT),$(=vT1)}>} actualCost) for actual cost

=Sum({<YearFieldName={$(=vT),$(=vT1)}>} budgetCost)/Sum({<YearFieldName={$(=vT),$(=vT1)}>} actualCost) - 1 for margin

anutosh_dhar
Contributor

Re: set analysis

thanks

anutosh_dhar
Contributor

Re: set analysis

thanks