cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert Char to Keyfigure in query

Former Member
0 Kudos

Hi guys,

I'm using a characteristic called ZONTIME (On time) for Aging report. This Characteristic holds a positive number, negative number or a zero. This calculation is doen at the DSO/cube level transformation using a field routine. ZONTIME = Clearing Date - Net Due Date.

The positive number indicates that the invoice was cleared x number of days "early"; the negative value indicates that the invoice was cleared x number of days late and zero means that the invoice was cleared 'on time'.

The idea is that I want to use this characteristic in the query and put restrictions on it as following:

Early                     ZONTIME < 0

On Time                ZONTIME = 0

0-15 days              0 < ZONTIME <= 15

Greater than 15      ZONTIME > 15

The issue that I'm running into is that when I try to save this query definition, I get hte following error: "The query has to specify a key figure"

I think the problem is that ZONTIME is defined as a Characteristic in BW. Can someone please help me in getting aroung this error?

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

ranganath_korata
Contributor
0 Kudos

Hi,

You have to use a Formula variable for that. Please search in SCN about it and you'll find plenty of posts.

Thanks,

Ranga.

Former Member
0 Kudos

I did search and I found some articles/docs. The issue that I'm seeing is that they seem to mention that the Char has to be defined as NUM in BW for this to work. Is that right? At the moment, my Char ZONTIME is defined as a CHAR and not NUMC.

ranganath_korata
Contributor
0 Kudos

Hi MD,

We can create a Formula variable with replacement path on a Characteristic that is of data type CHAR.

Thanks,

Ranga.

Former Member
0 Kudos

char can be converted but the values should be convertible. i.e. system can't convert abcd to 1234. This feature is mainly for converting dates to key figures so that dates can be calculated. Or values like 1, 2 3 4...being numbers they are stored in char...so can be converted.