Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Count the frequency and output in every month

fangyi189
8 - Asteroid

Hi all,

 

I have a dataset like this :

 

ActivityStart_dateEnd_dateTotal number of days
Running01/01/1701/01/171
Dancing03/01/1704/01/172
Squash20/04/1720/04/171
Running23/04/1725/04/173

 

and I want the output to be like this

 

ActivityAprilMayJuneJulyAugSeptOctDecJan
Running300000001
Dancing000000002
Squash100000000

 

So it'll count the total number of days and put it according to the months. It starts at April due to the financial year. 

Do you guys have ideas how to output it out like the table above?

 

Thanks!

6 REPLIES 6
LordNeilLord
15 - Aurora

Hey @fangyi189,

 

This workflow should give you the desired output:

Frequency.PNG

 

 

fangyi189
8 - Asteroid

Hi, this has helped a lot. (:  May I enquire why you did both join and right join for the join tool?

fangyi189
8 - Asteroid

Hi,

 

I have this error after I changed the format of the date. Do you mind seeing the error for me? Been trying to solve it for awhile.

 

 

LordNeilLord
15 - Aurora

 

Hey @fangyi189,

 

Weirdly I didn't get an error when I ran your workflow (but I expected one).

 

In my original version I had used DateTimeParse, to convert your date into a proper date..but with your dates as they are this is no longer needed. I have updated the formula to reflect this.

 

In answer to your other question, I union'd the R & J outputs of the join because I wanted to make sure that I had an entry for every month regardless of whether there was an activity value for that month.

fangyi189
8 - Asteroid

This new formula helps (: thank you!

MAAbdullahAlMubarah
8 - Asteroid

@LordNeilLord  What About if there is no end date? 

Labels