4 Replies Latest reply: May 23, 2013 5:20 AM by Adrian Nugraha

# Create Table or Field on-the-fly After a Filter Applied

Hi QV Experts! .... and Master Sokkorn Cheav

I have this table:

### SOURCE TABLE

PeriodCityScoreWeight
2010Jakarta1215%
2010New York3025%
2010Melbourne530%
2010Madrid5810%
2010Tokyo1510%
2010Prague610%
2011Jakarta2210%
2011New York2925%
2011Melbourne410%
... and so on... and so on... and so on
... and so on

I want to create table below (which is always updated by script or something) after filter for PERIOD applied:

In example below, filter PERIOD = 2010 applied.

### ON-THE-FLY TABLE

Rank PeriodCity

Weighted Score =

(Score * Weight) * Average({\$<City=>} Score) * 100

32010Jakarta8.57
12010New York35.7
42010Melbourne7.14
22010Madrid27.6
52010Tokyo7.14
62010Prague2.85

How can I do this within QV:

1. Run the calculation and create table on-the-fly after filter period applied
2. Automatically give rank based on weighted score

Please help. Thank you.

• ###### Re: Create Table or Field on-the-fly After a Filter Applied

See attached qvw

• ###### Re: Create Table or Field on-the-fly After a Filter Applied

Got it! Thank you very much Gysbert

• ###### Re: Create Table or Field on-the-fly After a Filter Applied

Dear Mr. Adrian,

Ahh I missed this post since earlier.

Gysbert give you the best method. And here is a new one that can work around.

Let try creat two expression

1. Weighted Score

Label: Weighted Score

Definition: Sum(Score*Weight)/Avg(Total {\$<City=>} Score)

2. Rank

Label: Rank

Definition: Rank([Weighted Score])

This is just another solution for your to consider.

Regards,

Sokkorn

• ###### Re: Create Table or Field on-the-fly After a Filter Applied

Thanks Sokkorn!

Gysbert answer it really well.

I just need the idea to create a chart with type = STRAIGHT TABLE and then add some expressions on it.

Well I think QV should differs STRAIGHT TABLE from chart because it is a little bit confusing when you need to build one.