Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Replace Set Anlisys with If statement

Hello to all,

I have an old version of QLV (Vers 7.xxx)

how do I replace a statement of Set Analysis

    Sum( {<Year={"$(=max(Year))"}>}  Num)

with an If statement.

I tried

     Sum (if (Year = max (Year), Num,''))

but it does not work.

  Thank All

7 Replies
rajeshvaswani77
Specialist III
Specialist III

Hi Marino,

You have to do at script level. It will be a calculation where you will use function like above/ peek.

Just replacing the Expression will not work.

thanks,

Rajesh Vaswani

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I think what you will have to is create a variable, and use that in the expression:

variable   vMaxYear  definition  =Max(Year)

(Note that the = is part of the expression. This is important as it means that the variable is evaluated as soon as you make a selection, and not within the chart itself)

Now you can say

     Sum( If(Year=$(vMaxYear ),  Num))


HTH

Jonathan


PS: Why not upgrade to a more recent version?



Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Colin-Albert

Hi Marino,

Try this          sum(if(Year =max(total Year), Num))

Regards

Colin

Not applicable
Author

hi,

use Sum (if (Year = max ({1}Year), Num,''))

Regards,

Abhishek

Colin-Albert

This command uses set analysis though      max({1} Year)

Not applicable
Author

Thank Albert,

I used the instruction that you give me advice

if I make a table with 3 columns over the years, from 2013 to 2011,

education works.

If I select the year 2012, I expect that the table is for

the year 2012, 2011 and 2010. Instead I see only the first column.

The instructions I use are:

Column 1 Year 2013: sum (if (year = max (total year), Num))

Column 2 Year 2012: sum (if (year = max (total (year-1)), Num))

Column 3 Year 2011: sum (if (year = max (total (year-2)), Num))

Why is this happening?

Colin-Albert

Set analysis allows you to break the link between the list box selections and the data in the charts.

Without set analysis you cannot do this.

When you select 2012, the visible data set will only contain 2012 data.

Upgrade from v7 to get this functionality, v7 is very old.