Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Can someone please suggest what can be done to achieve this?I have a table that returns following.
Name | Value |
---|---|
California | 100 |
Sandiago | 50 |
LA | 30 |
Texas | 200 |
Houston | 40 |
Austin | 40 |
Users wants to see this on the chart.
Name | value |
---|---|
California | 180 |
Texas | 280 |
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...
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
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;
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
Hi,
I created a calculated dimension and it worked fine.Plz find attached.
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