Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
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 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.
Hi
Can you explain third point? Not sure, what is that?
Use no dimension or Year as dimension
i am talking about expression.
should i map all those variable into the expression?
Hi
Yes, Use both expression ..
1st: =Sum({<Year = {$(vT)}>}budget cost)
2nd: =Sum({<Year = {$(vT1)}>}budget cost)
Hope it helps
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
thanks
thanks