Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

AGREGATION

  Good morning, please, i need some help on this.

How can i get,  with a table of this kind of data:

    

MARKETSTATE_NAMESum
spainAndalucia1
spainMadrid3
spainValencia5
spainGalicia7
portugalPorto2
portugalLisboa1
portugalSetubal2

Obtein an objct table like this:

 

STATE_NAMESum
Andalucia1
Madrid3
Valencia5
Galicia7
portugal5

Thanks a lot!

Belén

1 Solution

Accepted Solutions
Not applicable

Re: AGREGATION

Hi,

Use the below calculated dimension in your chart.

=if(MARKET = 'spain', STATE_name,MARKET)

12 Replies
luis_pimentel
Contributor III

Re: AGREGATION

The easiest way it will be in your load script, do something like:

LOAD

     MARKET,

     STATE_NAME,

     IF (MARKET = 'Portugal', 'Portugal', STATE_NAME) AS STATE_NAME_AUX

FROM yourfile...

and then use STATE_NAME_AUX as a dimension, and sum(yourvalue) as a expression.

Hope that helps.

Re: AGREGATION

Can you share your application or sample file?

Not fully understood your requirement from your question

Not applicable

Re: AGREGATION

What i want is to do it from the chart, in properties Dimension. As a calculated dimensión, if posible.

Thanks


Not applicable

Re: AGREGATION

Hi,

Use the below calculated dimension in your chart.

=if(MARKET = 'spain', STATE_name,MARKET)

Not applicable

Re: AGREGATION


Thanks Venugo, That fits with my problem.

Other question... it is possible, also with other file, ( also in the dimensión):

From this data:

 

MARKET
STATE_NAMESumChannel
spainAndalucia1C.C
spainMadrid3Other
spainValencia5On line
spainGalicia7Other
portugalPorto2On line
portugalLisboa1C.C
portugalSetubal2Other

Get a table object like this?  Taking  also On line and Portugal inside the table whith the state_name

STATE_NAMESum
Andalucia1
Madrid3
Galicia7
On line7
portugal3

Thanks a lot!

Belén

Not applicable

Re: AGREGATION

Hi,

Try with below in your expression.

Sum({<Channel -= {'On line'}>}Sum)

Not applicable

Re: AGREGATION

Is not working.....

=if(MARKET = 'spain', STATE_name,MARKET) Sum({<Channel -= {'On line'}>}Sum)

all together?


Re: AGREGATION

Below should be in script

=if(MARKET = 'spain', STATE_name,MARKET as STATE_name


Below as table or chart expression.

Sum({<Channel -= {'On line'}>}Sum)

Not applicable

Re: AGREGATION

Hi,

Use Dimension as : =if(MARKET = 'spain', STATE_name,MARKET)

and Expression could be : Sum({<Channel -= {'On line'}>}Sum)

Community Browser