You are not logged in.

Dear visitor, welcome to Palo Community Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

  • "nicolas281088" is male
  • "nicolas281088" started this thread

Posts: 47

Date of registration: Mar 17th 2009

Location: Belgium

  • Send private message

1

Friday, April 24th 2009, 11:56am

Ranking with a rule

Hello all,
I want to know if it's possible to introduce in my cube, a concept of ranking?
I explain.
In fact, I have 2 dimensions and 1 measure.
like this :
Dimensions clients (with all the clients)
Dimensions products (with all the products).
Measure : value.

What I want is to put a ranking based on the value.

So like this :
Products
TV | PC |CAR
Value| Ranking| Value Ranking| Value Ranking
Clients 25| 2
Jean 12| 3
Pierre 5| 4
Nicolas 2| 5
Peter 50| 1

And so one...

Someone can tell how can I do this?

Thank in advance.

Nicolas.

This post has been edited 1 times, last edit by "nicolas281088" (Apr 24th 2009, 11:57am)


  • "h_decker" is male

Posts: 763

Date of registration: Oct 26th 2005

Location: Cologne, Germany

  • Send private message

2

Friday, April 24th 2009, 12:11pm

RE: Ranking with a rule

Hi,
like this?

Add measure ranking to measure dimension. Then the rule would be like this

['ranking'] = IF(['value']<5,5,IF(['value']<10,4,IF......... ,1))) no. of brackets brackets depends on number of nested IFs.

Hope this helps.

Holger

  • "nicolas281088" is male
  • "nicolas281088" started this thread

Posts: 47

Date of registration: Mar 17th 2009

Location: Belgium

  • Send private message

3

Friday, April 24th 2009, 12:31pm

Tank you for the answer.

But it look not very automatic.
That I would is an automatic function, so I just have to select the measure that I want to rank, and the ranking is done automaticly.

Is there a function available in the rules to do that?

Thank in advance.

Nicolas.

This post has been edited 1 times, last edit by "nicolas281088" (Apr 24th 2009, 1:50pm)


  • "Pommie" is male

Posts: 411

Date of registration: Feb 21st 2007

Location: Lytham UK

Occupation: OLAP consultant specialising in retail

  • Send private message

4

Monday, April 27th 2009, 7:03pm

There is no simple way to do this - it's a bit like the min / max problem requiring a large number of recursive calculations.

Your best bet might be to populate an array using Visual Basic and bubble sort it before posting the data back into Palo.
Best wishes

John Hobson
The Planning Factory, Lytham, UK
www.planfact.co.uk

  • "nicolas281088" is male
  • "nicolas281088" started this thread

Posts: 47

Date of registration: Mar 17th 2009

Location: Belgium

  • Send private message

5

Tuesday, April 28th 2009, 8:23am

Mhhh shade.

Thank you for the answer.

  • "Pommie" is male

Posts: 411

Date of registration: Feb 21st 2007

Location: Lytham UK

Occupation: OLAP consultant specialising in retail

  • Send private message

6

Tuesday, April 28th 2009, 9:08am

Just to make this a little more difficult there is also the issue of ambiguity to consider.

2 litre Coupe may be 5th most popular car by sales in Belgium so ['Rank', 'Belgium', '2 Litre Coupe'] = 5 but Belgium may be the 9th best market for it in Europe so ['Rank', 'Belgium', '2 Litre Coupe'] also = 9
Best wishes

John Hobson
The Planning Factory, Lytham, UK
www.planfact.co.uk

Cuitlahua

Professional

  • "Cuitlahua" is male

Posts: 32

Date of registration: Feb 27th 2009

Location: Hungary

  • Send private message

7

Wednesday, April 29th 2009, 1:19pm

This is really not an easy task even in softwares older than palo. The core of your problem is that you would you like to put the rank number into cells as value (if I understand well.)

Some years before I had the same problem in TM1 where I could solve it using dinamic subsets and processes. I tried to check from the ETL manual if the same thing is possible in Palo, but as I find it, exactly the same thing is impossible and maybe working with the ETL server is not the nicest thing anyway.

However, maybe a solution can be engineered. I have not tried it now, check it out! Here are the steps:

1: Create a subset in Excel in the Products dimension sorting the elements by the values that are the base of the ordering. (You have Palo.Sort, it should do that for you.)
2. So you have the sorted product names in one column of an Excel sheet. Now loop through the list and build a technical dimension within Palo. If the dimension already exists, you can destroy it before the building, it has really technical purposes.
3. The elements are ordered in the dimension, right? The product with the largest value is the first dimension element, the product with the second largest vaélue is the second and so on. Now, using the Palo function PALO.EINDEX you can retrieve the order number for each product. Note that the rule necessary for this need to be written just once. You do not have to change it later and the rule is independent of the number of the products.
4. This way you can have the ordering number besides the basic values, like you wished: Product |Value | Rank. One more step: do not forget, that tha Rank will change each time you do the above procedure, because the Palo.Eindex will retrieve the current element index. Maybe you would like to save the ordering somewhere, inside or outside Palo - but that is another story.

-------

One warning: I have a post in an another topic where I indicated that the sorting may be buggy when based on cells with marker and works only for cells without markers. This far no one has validated or denied this. Maybe only sorting based on unmarkered cells is secure.

Cuitlahua

Professional

  • "Cuitlahua" is male

Posts: 32

Date of registration: Feb 27th 2009

Location: Hungary

  • Send private message

8

Wednesday, April 29th 2009, 1:32pm

One more little issue: very likely that if you have more products with the same value then you can not influence the rank number.

Rate this thread