i have pivot produced through a pivottable macro. can we rename the column names just like we do in excel pivot
Hi @Nags Subramanian ,
Firstly gave you the hint in your previous question and then came across this one: wrap your Pivot Table macro in the Table Transformer macro and rename your columns as you wish:
SELECT T1.'Long column name coming from pivot' AS 'New beautiful name'
FROM T1
Hi @Janice ,
Please add some custom tags for us:
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, got stuck with an issue on this please. could you help.
Below is my first table using a table transformer macro. In this i have coloured the Story End column based on component status.
Below is the pivot table produced based on the above table with sort order as column headings. i need to bring in the component status since i need the coluring based on that column. hence each application is displayed on multiple lines based on status.
Now i applied a table transformer macro on top of this pivot to display the column names in more readable way.
2 issues:
1. How to show the dates grouped in one line for one application?
2. How to colour the date column based on the component status.
code currently used is as below:
SELECT T1.'ICTO', T1.'Application Name',
min(T1.'Literal of Story End 1 - Design') as 'Design',
min(T1.'Literal of Story End 3 - Onboard') as 'Onboard',
min(T1.'Literal of Story End 4 - Test') as 'Test',
min(T1.'Literal of Story End 5 - Deploy') as 'Deploy',
min(T1.'Literal of Story End 6 - Cut over') as 'Cut over'
FROM T1 group by T1.'ICTO', T1.'Application Name', T1.'Component Status'
any suggestions please !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What concerns the first question, maybe I've got it wrong: if you have, for example, two dates for the same application and their component status is the same, then you'll get these two dates in one cell of your Pivot Table macro.
As I see from your screenshot, in your Pivot Table macro each date is in a separate cell (each date has a unique set of status-application-ICTO).
The same picture you have after the Table Transformer macro: the only difference is that all the merged cells (ICTO, Application Name) will be unmerged again. This is how the macro works - you need to choose if you want a "beautiful" pivot table or a colored table.
As you show all the dates for your Pivot Table (I see the Operation Type as Literal) you don't need "min" or "group" in the SQL query. The idea was to do everything in your Pivot Table macro with a more friendly UI and use the Table Transformer macro just for coloring and renaming your columns.
So, to color your columns based on the statuses you need to use a FORMATWIKI function (like you did it in the very beginning for the first table). The only difference is that you need to use the CASE WHEN conditions for each column separately. I mean that you check the status and color the 'Literal of Story End 1 - Design' column, then check the status and color the 'Literal of Story End 3 - Onboard' and so on.
And as you have in you current query, after the "AS" clause you may type in the shortened name of your columns.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Thank you. i am trying this differently now but getting into a different issue in the final transformed table.
code for the 2 highlighted columns are:
T1.'Literal of Story End 1 - Design' as 'Design date',
FORMATWIKI("{cell:bgColor=LightBlue}" +T1.'Literal of Story End 1 - Design' + "{cell}") as 'Coloured date',
same column printed without fomatting and second printed with formatting.
why is the second one printing as numbers instead of the date value please?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please try to add the FORMATDATE function:
FORMATWIKI("{cell:bgColor=LightBlue}" + FORMATDATE(T1.'Literal of Story End 1 - Design') + "{cell}") as 'Coloured date'
The date should be formatted using the date format that is chosen in the Settings tab of your Table Transformer macro.
Or you may show how you want your date to be displayed in the function itself:
FORMATDATE('Column with dates', "M dd, yy")
where "M dd, yy" is your preferred date format.
The current set of numbers is a default UNIX date format in seconds.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Thanks, FORMATDATE usage worked. i have run into another issue where if you could help please.
in some cases, the value in T1.'Literal of Story End 1 - Design') is 2 or 3 dates together separated by a , eg:
Dec 09, 2023, Nov 11, 2023, Nov 15, 2023
this is due to the way the pivot table built unfortunately.
in the table transformer macro, How do i split this into individual dates and then display as formatted date like the below. one below the other in the same cell using this command:FORMATWIKI("{cell:bgColor=LightBlue}" + FORMATDATE(T1.'Literal of Story End 1 - Design') + "{cell}") as 'Coloured date'
Dec 09, 2023
Nov 11, 2023
Nov 15, 2023
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is done in the Pivot Table macro: please go to the Options tab, scroll it down and locate the Literal value delimiter field.
By default it is comma. But you may choose other options as well: for your case it will be "Line break".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Many thanks for your help so far. its almost there. i have one final issue to be resolved please.
i have a pivot table value returned as below. this pivot table setting Operation type as Literal.
To avoid the nasty headers, i am applying a table transformer macro on top of this pivot table to produce like below.
code is like below. this is for the Deploy column. basically since it was returning unix value of the date (though Literal was mentioned as operation type). i applied the below formula to use formatdate or display the literal as it is. some dates are concatenated by ;, which i am printing as it is.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately, I couldn't reproduce the issue where the Table Transformer macro returned unix date format after the Pivot Table macro. So, as in your first example you had one date per cell, the FORMATDATE function served as a kind of a workaround.
For your current case when you have different numbers of dates per cell, you may try to use the simple FORMATWIKI function for coloring from the first example (when you color by status and don't pay attention at the string length) but change pluses to commas:
FORMATWIKI("{cell:bgColor=LightBlue}", T1.'Literal of Story End 1 - Design', "{cell}") ...
Commas help to preserve initial cell formatting and your dates coming from the Pivot Table should be treated as simple strings.
Besides if you choose a line break as a Literal value delimiter in the Pivot Table, commas will preserve it and your dates will be positioned on separate rows in a cell.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If this doesn't help, I can suggest referring to our support. Attach a page storage of your page (upper right corner -> menu ... -> View storage format) and we'll be able to recreate exactly your page with the source table and macros.
Also as you have Server/Data Center judging by your tags, please check what version of the app you are using. The current one is 10.3.0 - if yours is an older one, please update.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank you. i have implemented something similar to this just now. i appended the dated value in the source table with some literal and hence it is treated as literal always. at the final table transformer table i replaced the literal i added with spaces and printing it. it kinda works.
is there a way for this post be hidden from external people. i have shared some screenshots with some company data of application, and would like this to be hidden.
or can we atleast delete the images on all posts?
thank you and apologies.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you can edit your initial question and all your comments and remove the images. When you click on the thee dots menu near each entry, you will see an "Edit reply" option.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.