6 Replies Latest reply: Jan 2, 2013 7:37 AM by philipp.weiter

# Calculated dimension based on expression

Dear all,

I have some trouble with the methodology of calculated dimension and hope for your support

I try to create a table which shows only a specific customer group. For that I've defined the expression "Kundenklasse" with this definition: =If([Accumulated Sales] <= A_Perc_Kunde * Sum(Total IstWert),'A',Null()).

The plan is to see only customers with Kundenklasse A in the table

To realize that I tried to define the selected Dimension (Customer_ID) as calculated dimension with the following expression: =If([Kundenklasse] = 'A',Customer_ID)

Unfortunately it doesn't work QlikView highlight the "Kundenklasse" as bad field name and I don't know why or how to solve this problem.

Does anybody have a clue?

Nachricht geändert durch philipp.weiter

• ###### Re: Calculated dimension based on expression

have you tried this

If(column(1) = 'A',Customer_ID)

column (1) means first Express which Name Kundenklasse

Hope This helps

• ###### Re: Calculated dimension based on expression

Hey Luminary,

thank's for your approach. In my case it's column(4). If I try your formula there is no "bad field" error but it's still not working

The new result:

do you or anybody else have an other idea?

KR,

Philipp

• ###### Re: Calculated dimension based on expression

You need to use the aggr function in your calculated dimension. Perhaps this works:

If([Accumulated Sales] <= A_Perc_Kunde * aggr(Sum(Total IstWert),Customer_ID),Customer_ID)

If it doesn't it would help if you could post the qvw document you're working on or some sample data.

• ###### Re: Calculated dimension based on expression

Hi Gysbert,

thanks for your support. Sadly it doesn't work. Pls find the qvw document in the attachement of my original posts.

• ###### Re: Calculated dimension based on expression

I don't think what you want to do is possible that way. But if you are using QV11 you can use dimension limits instead. Select the option Show only values that accumulate to and put A_Perc_Kunde in the first input field and select relative to the total in the dropdown list next to it.

• ###### Re: Calculated dimension based on expression

That's it! Thanks a lot