Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

expression

I have data as mention below.

TypeSub TypeValues
YA100
YB200
YC300
NA400
NB800
NP900
NR100
YA200
YB300
YC2000
YD3000
NE100
NF200
NB5000
NC2000

requirement is like i have to calculate sum of Values.

when user select Type Y from list box and respective values from Sub Type list box it should show maximum value of values as sum.

Like if user select Y from Type list box then select A,C,D from another Sub Type list box sum of values should display 3000 that is maximum value.

in another case if user select N from Type list box and A,B,P from Sub Type list box sum of values should be 2100 that is sum of A,B,P.

Please let me know how to get this sum expression to show above requirement.

5 Replies

Re: expression

May be this:

Sum({<Type, [Sub Type] = P([Sub Type])>} Values)

UPDATE: I am not sure how you are coming up with those values? Can you elaborate a little?

Not applicable

Re: expression

I have a similar table as i mentioned and i need to generate the out put like i explain in the question.

manucamon
Valued Contributor III

Re: expression

Hi Shantnu, try this expression, this is performed for a table chart.

=Pick(Match(Type,'Y','N'),

    Sum(Aggr(Max(Values),[Sub Type],Type)) ,

    Sum(Aggr(Min(Values),[Sub Type],Type)))

Regards!!

Re: expression

I guess I don't understand the logic you are trying to use . May be Manuel solution is what you need here

Re: expression

Hi,

It seems that you want Max value and also the Sum of value. Both cant be achieved in single expression.

You need to use two expression, one for Max and one for Sum.

and the expression will be simple.

For Max it will be Max(Values) and for Sum it will be Sum(Values)

Regards,

Kaushik Solanki

Community Browser