Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Tejeswari_123
Contributor
Contributor

Aggregation in Chart Expression

Hello Team,

We are working on requirement where we need to display the Value aggregated to only Project name if the Hierarchy level is 2 .

I am trying to calculate aggregated the values based on Project Name, but the aggregated amount is correct only for one row if the Project name is repeating in another row with different Project Number

The only difference between those rows is project number remaining column values are same.

Please find sample data which was given below   

Project Name

Required  Value

ABC

112

LMN

310

DEF

465

 

Hierarchy level

Programme

Project Name

Project number

Value

Required Value

3

Progarmme1

ABC

PRJ1

0

112

3

Progarmme1

ABC

PRJ2

112

112

3

Progarmme3

LMN

PGM1

310

310

3

Progarmme4

DEF

PRJ4

465

465

3

Progarmme4

DEF

PRJ3

0

465

 

I am using below expressions for aggregating the values

Value = if([Hierarchy Level] =3,Sum(aggr((Sum({<[Column]={'xyz'}>}[Amount])),[Project Name]))          

            

I am trying in different ways like using group by in QV script  but it doesn't work , Can anyone  please help me here ?

Thanks,

Tejeswari

  

Labels (2)
3 Replies
vijayaganesh_s
Partner - Contributor III
Partner - Contributor III

Hello Tejeswari,

If you are having the Project Name with the Required Value as a separate table as mentioned in your example then please use only function -> Only(Required Value), this will work only if you are using the Project Name in your visual, attached image for your reference.

vijayaganesh_s_0-1658237129619.png

 

BR,

Vijay

 

Tejeswari_123
Contributor
Contributor
Author

Hi Vijay,

Required Value is not available in Table , that value is supposed to our expected value . Apologies for the confusion.

Thanks,

Tejeswari

vijayaganesh_s
Partner - Contributor III
Partner - Contributor III

Hello Tejeswari,

Thanks for the clarification, please try Sum(Total <[Project Name]>Value), Defining the Total Scope based on the Project Name would help!

vijayaganesh_s_0-1658295304401.png

 

BR,

Vijay