Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, this is a follow up of my previous questions regarding bucket creation for values in my column that is either positive or negative. The + and - figures will always balance out at the end. Is there a way where I can take this column and create 2 separate columns for one to hold positive values and the other negative values.
Example -->
Load
Project,
if(Values<0,Values) as Negative,
if(Values>00,Values) as Positive
From ........
Load
Project,
if(Values<0,Values) as Negative,
if(Values>00,Values) as Positive
From ........
tab: load * Inline [ Project,Values abc,100 abc,-100 def,200 def,-200 ghi,300 ghi,-300 ]; load Project, Values as Positive resident tab where Values >0; inner join load Project, Values as Negative resident tab where Values <0; drop Table tab;
Thanks for your answer. To clarify, I will have thousands of rows. Would I be able to do a for loop within the load script in order to avoid manually entering values as you have mentioned.
Thanks.
Something similar I will try to write a for loop to see if that will bring in the values to separate between positive and negative values.
update - instead of writing a forloop I created a bucket to denote whether the values inside column 'A' was a 'Positive' or 'Negative'. Once I had this in place, I was able to simply drag these 2 new columns into a pivot table against a dimension and show all negative values on one column and positive on another.