Transposing Pivot Table
Current format ^
The format I want to achieve ^
Hi everyone, I am currently working on a project and the client wants the values to be displayed in rows, grouped by Country (as seen in the image above). However, the default in Sisense is to put the values in columns. Switching the rows and columns also does not seem to resolve this issue.
I've attached the current format of the table I have in Sisense, as well as the desired format I am going for. Essentially, I want to recreate the format of the Tableau table in Sisense 🙂
Thank you and please let me know if anything was unclear.
You could create a small table in your EC for metrics' names.
select 1 as key,1 as id, 'metric 1' as metric union all select 1 as key,2 as id, 'metric 2' as metric union all select 1 as key,3 as id, 'metric 3' as metric
Key is created for relationship with any needed table in EC. And in that table, we also add the custom field 'key' with 1. It allows duplicating rows for each metric in the pivot table.
The next step is creating a formula for the pivot table:
case when avg(id)=1 then Sum(metric 1) when avg(id)=2 then Sum(metric 2) else Sum(metric 3) end
For example, for this set of data:
I got this table:
- Angelina
[email protected]