Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
CELAMBARASAN
Partner - Champion
Partner - Champion

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

View solution in original post

8 Replies
MayilVahanan

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

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Anonymous
Not applicable
Author

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.

MayilVahanan

Hi

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

     Use no dimension or Year as dimension

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Anonymous
Not applicable
Author

i am talking about expression.

should i map all those variable into the expression?

MayilVahanan

Hi

     Yes, Use both expression ..

    

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

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

     Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
CELAMBARASAN
Partner - Champion
Partner - Champion

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

Anonymous
Not applicable
Author

thanks

Anonymous
Not applicable
Author

thanks