Get Free Trial

Grouping field or Hierarchy Dimension field

Quan Hieu asked on December 14, 2016

Hi team, 

I have 3 questions about the Grouping or Hierarchy Dimension field:

1. Could we define a group field like this?
For example here I have a group “Region” which contains 2 fields: “Country” and “City
So if I can define this group then we can see the Region field in Drag Dimensions Area. And when I drag it into Rows Area. It could be displayed like this:


For example: 

England                     1          2          3
            London          1          2          3
USA                           4          5          6
            New York       4          5          6

2. If yes, then could we dynamically exploded the string into multiple fields which were grouped together?

For example: 
Currently I have a JSON datasource with a field name CategoryFullPath and the value of this field can be like:
ALL,Apparel and Footwear,Apparel,Women’s Apparel,Women’s Pants
ALL,Apparel and Footwear,Apparel,Women’s Apparel
ALL,Apparel and Footwear,Apparel,Women’s Apparel,Women’s Outerwear

So I can base on it to create a new group field by split the value to new fields (By split ‘,’ chacter)

So I will have 1 group field for example name is: Category Hierarchy which contains 5 fields and can be displayed like this: 

ALL                                                                                                                                     1            2            3
    Apparel and Footwear                                                                                                     1            2            3
                                        Apparel                                                                                        1           2            3
                                                        Women’s Apparel 
                                                                                    Women’s Pants                                1           1           1
                                                                                     Women’s Outerwear                        0           1           2

3. Could the Date dimension hierarchy like this? Or we have some thing the the like Group Interval here : Grouping date section

  • year” — groups by years
  • quarter” — groups by quarters
  • month” — groups by months
  • date”

    So we have 2 type of hierarchy:

    1. If we drag the Date field directly to the Column Area, this can view like this:


    2. If we define a new field from this Date field using Group Interval, for example GroupInterval = “Month”
    We can drag this field to column area and view data group by Month only, like this:
                   January  Febrary March
    Sale          1            2           3

4 answers

Roman Petrusha Roman Petrusha Flexmonster December 14, 2016

Hi Quan Hieu,
1. Yes, you can define groups. Please look at this sample:
I recommend you to read more about data types in JSON here:
2. No, strings can’t be dynamically exploded into fields. This feature is applicable only for date types.
3. Yes, it’s possible. To make date fields be interpreted as a date, you should define data type, for example, "type":"date", "type":"date string", "type":"year/month/day" or "type":"year/quarter/month/day".
Please find more here:
Does it help?

Quan Hieu December 14, 2016

1. Yes, you can define groups

So you mean that we can only define the group by update the json structure that we imported to the tool. But could we do it if we import by CSV file? I mean that I can define the group before importing the csv file, then I can use it.

Roman Petrusha Roman Petrusha Flexmonster December 14, 2016

Quan Hieu,
Yes, this means that you should predefine data types in the JSON structure.
If you prefer to use CSV the predefined types are also required.
Please note that you can use not only static CSV or JSON files but server-side scripts as well. So you can write the very simple script which add types to the first row of your data file.

	var pivot = $("#pivotContainer").flexmonster({
		toolbar: true,
		report: {
			dataSource: {
dataSourceType: "CSV", filename: "http://your_server/your_script_path" } }, licenseKey: "XXXX-XXXX-XXXX-XXXX-XXXX" }); </script>


Quan Hieu December 14, 2016

Ok, thanks Roman.

Please login or Register to Submit Answer