Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Post crosstab error

96sudeshnasen
7 - Meteor

I am using the cross tab tool to get the status of certain contracts. 

 

For eg: Raw data

 

StatusNumber
Closed12
Open2
In progress9
Open1
New23

 

 

Cross tab

 

Closed OpenIn ProgressNew
123923

 

Now further down, I have some formulas to sum all of these : Total_Assigned: [Closed]+[Open]+[In progress]+[New]

 

The problem is that when I run the workflow at different times of the financial year, all these statuses might not be present i.e. we might not have New contracts or open contracts. Then he formula tool throws an error.

7 REPLIES 7
atcodedog05
22 - Nova
22 - Nova

Hi @96sudeshnasen 

 

Why dont you use a summarize to sum before cross tabbing.

atcodedog05
22 - Nova
22 - Nova

Hi @96sudeshnasen 

 

Another approach would be to use Total column option of cross tab

atcodedog05_0-1607066300497.png

Aggregations selected

atcodedog05_1-1607066326428.png

Scroll down

atcodedog05_2-1607066338879.png

This dynamically selected all the status's number and sums it up.

 

Hope this helps 🙂 Feel to ask if you have any questions


If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

96sudeshnasen
7 - Meteor

Slight correction:

 

The formula will not used [Closed] contracts in the sum. So if I use summarize before crosstab, I still have to filter for contracts other than the closed ones. Even then, have to do a hardcoding of the contract status in the filters.

 

Is there a better dynamic way? Summarize would surely work if I wanted the sum of all contract types

atcodedog05
22 - Nova
22 - Nova

Hi @96sudeshnasen 

 

Why dont you create another calculated field

 

Number (No closed)

 

If [status]="closed" then 0 else [number] endif

 

That way it will sum only other than closed.

Qiu
21 - Polaris
21 - Polaris

@atcodedog05 

I think @atcodedog05  is suggesting something like this, and you can keep the Cross Tab format as you need.

This is dynamic and will not throw error even your columns change.

 

1204-96sudeshnasen.PNG

grazitti_sapna
17 - Castor

Hi @96sudeshnasen, why don't you  give this a try.

grazitti_sapna_0-1607067139386.png

 

 

If this works for you kindly mark this post as solution.

 

Thanks.

 

Sapna Gupta
atcodedog05
22 - Nova
22 - Nova

Hi @Qiu 

 

There is a option in crosstab itself to get the total column

atcodedog05_0-1607066858362.png

 

@96sudeshnasen adding to @Qiu suggestion

Since we dont want closed in total we modify like this

atcodedog05_1-1607067043739.png

35 doesnt include 12 closed

 

Hope this helps🙂

 

Labels