11
Views
2
Solved
###### How to create chart??
Question

Hi all,

I have a age column and  I want to convert  into a age attribute.

Req:

DataBase:

Thanks

Mansur

Solution

Hi All

Create a new attribute :

Write this condition in the formulla:

```If(((person.Age)>0 and (person.Age)<=10),"0-10",
If(((person.Age)>10 and (person.Age)<=20),"10-20",
If(((person.Age)>20 and (person.Age)<=30),"20-30","")))```

Thanks

Mansur

HI Mansur,

Use Sql Query widget and write query like below

``` SELECT t.range as Age, count(*) as [number of occurences]
from (
select case
when {Data2}.[Age] between  5 and 25 then '5-25'
when {Data2}.[Age] between 26 and 34 then '26-34'
when {Data2}.[Age] > 34 then '34+'
end as range
from {Data2}) t
group by t.range```

and below is the result of the query and the documentation of chart

https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/Charts_API/Create_Column_and_Bar_Charts

Best Regards

Devendra

Solution

Hi All

Create a new attribute :

Write this condition in the formulla:

```If(((person.Age)>0 and (person.Age)<=10),"0-10",
If(((person.Age)>10 and (person.Age)<=20),"10-20",
If(((person.Age)>20 and (person.Age)<=30),"20-30","")))```

Thanks

Mansur

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.