Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Thanks!
Look for Generic and CrossTable statements.
regards
Darek
Hi Steve, Use Generic Load to Pivot the table. Please go through the below blog post as reference.
http://community.qlik.com/blogs/qlikviewdesignblog/2014/03/31/generic
generic load was the one I was forgetting. (It gave wonky results on a very large data set with unique qualities that I had to pivot with if statements, but looks okay for this.)