- Posts: 3
- Thank you received: 0
Dynamic "pivot group" names for Unpivot
3 years 11 months ago #19487
by Serigraph
Dynamic "pivot group" names for Unpivot was created by Serigraph
Hi,
We receive a csv that contains dates in the header row. The values for each date is a quantity associated to an item part number. See attached for an example file.
We are able to successfully use the unpivot function to normalize these.
Our issue is this:
The dates change and are very important. When a date has passed, it is no longer given to us, and we see a new date in the future. For example in the file provided, once 10/17/2019 is over, it will no longer be given and we will see the next date in the future of 11/28/2019.
When using the unpivot function, in the "pivot group" tab, we have manually entered the dates under "pivot group." This cannot work for us due to consistantly changing values.
Is there a way to dynamically set a "pivot group" name to the header value?
We receive a csv that contains dates in the header row. The values for each date is a quantity associated to an item part number. See attached for an example file.
We are able to successfully use the unpivot function to normalize these.
Our issue is this:
The dates change and are very important. When a date has passed, it is no longer given to us, and we see a new date in the future. For example in the file provided, once 10/17/2019 is over, it will no longer be given and we will see the next date in the future of 11/28/2019.
When using the unpivot function, in the "pivot group" tab, we have manually entered the dates under "pivot group." This cannot work for us due to consistantly changing values.
Is there a way to dynamically set a "pivot group" name to the header value?
Please Log in or Create an account to join the conversation.
3 years 11 months ago #19488
by admin
Mike
ETL Architect
Replied by admin on topic Dynamic "pivot group" names for Unpivot
Hello
Is number of headers always the same?
Is number of headers always the same?
Mike
ETL Architect
Please Log in or Create an account to join the conversation.
3 years 11 months ago #19490
by Serigraph
Replied by Serigraph on topic Dynamic "pivot group" names for Unpivot
Yes.
Please Log in or Create an account to join the conversation.
3 years 11 months ago #19492
by admin
Mike
ETL Architect
Replied by admin on topic Dynamic "pivot group" names for Unpivot
OK in this case what you need to do is to convert your data into something like this.
We will create a working example for you
We will create a working example for you
Mike
ETL Architect
Please Log in or Create an account to join the conversation.
3 years 11 months ago #19493
by admin
Mike
ETL Architect
Replied by admin on topic Dynamic "pivot group" names for Unpivot
Mike
ETL Architect
The following user(s) said Thank You: Serigraph
Please Log in or Create an account to join the conversation.
3 years 11 months ago #19494
by admin
Mike
ETL Architect
Replied by admin on topic Dynamic "pivot group" names for Unpivot
I have attached the actual example for your convenience
Mike
ETL Architect
The following user(s) said Thank You: Serigraph
Please Log in or Create an account to join the conversation.