This content has been marked as final. Show 3 replies
Hi, I have a variety of if statements to pivot data like this:
if(AttributeName='Challenge' AND AttributeValue, AttributeValue) as [Email New Inquiry Challenge],
if(AttributeName='Forms' AND AttributeValue, AttributeValue) as [Email New Inquiry Forms],
if(AttributeName='General Program' AND AttributeValue, AttributeValue) as [Email New Inquiry General Program],
if(AttributeName='Gift Card' AND AttributeValue, AttributeValue) as [Email New Inquiry Gift Card],
Is there a single statement I can write to create these fields? Something like this in concept:
if(AttributeName AND AttributeValue, AttributeValue) as ['Email New Inquiry '&vAttributeName']
I had to unpivot lots of data due to varying field headers to get it loaded, and am using the if statements above to re-pivot the data from a single table. Many files have shifting names of operators for their field headers, or maybe a new inquiry type can be added etc, and I'd like the script to add new people itself without me having to keep track or anyone else having to communicate to me.
...and it just occurred to me the data sets for the particular dashboard that made me ask this question may not become too huge to just let a pivot table handle it, but still a correct answer to above would be helpful in other places where I do have huge data sets.
I will tap points to whoever solves above for me.