Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Chart

Hi,

Can someone please suggest what can be done to achieve this?I have a table that returns following.

NameValue
California100
Sandiago50
LA30
Texas200
Houston40
Austin40


Users wants to see this on the chart.

Namevalue
California180
Texas280


Sandiago and LA belongs to California,so the values of individaul cities should be added to the State value.And in the chart only State name would be visible (no city name).

Thanks...

5 Replies
rohit214
Creator III
Creator III

hey pooja

i tried but not getting proper answer.if u get correct answerplease let me know.

plz find the attachement .

may it helps you

thanks

rohit

Not applicable
Author

Hi, try with this

Map:

MAPPING LOAD * INLINE [

    Name, State

    California, California

    Sandiago, California

    LA, California

    Texas, Texas

    Houston, Texas

    Austin, Texas

];

Data1:

LOAD applymap('Map', Name) as Name2, * INLINE [

    Name, Value

    California, 100

    Sandiago, 50

    LA, 30

    Texas, 200

    Houston, 40

    Austin, 40

];

Data:

Load Name2 as Name,

    sum(Value) as Value

resident Data1

group by Name2;

drop table Data1;

SunilChauhan
Champion
Champion

you should first insure that how they should beelong to perticular state

if city's are link to state then it will easy to calculate.

on the basis of this table we can not achieve like that

Sunil Chauhan
Not applicable
Author

Hi,

I created a calculated dimension and it worked fine.Plz find attached.

its_anandrjs

Hi,

Sorry to response you late you have to maintain a second table which contains details of the State and cities see the script

Data1:

load * inline

[

Name,              Value

California,          100

Sandiago,          50

LA,                  30

Texas,              200

Houston,          40

Austin,              40

];

Data2:

load * inline

[

State, Name

California, California

California, Sandiago

California, LA

Texas, Texas

Texas, Houston

Texas, Austin

];

This will give you a correct result as you want just add details in second table and reload it.

See the attached sample also

Let me know about this if not works.

HTH

Rgds

Anand