Free Trial

Alteryx Designer Desktop Discussions

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

URGENT: Multirow formula error

satya04
8 - Asteroid

 

I am using multirow formula to calculate difference using this logic

 

IF !Contains([Period], "2013")
THEN
([Capital_expenditures]+[Row-1:Capital_expenditures]+[Row-2:Capital_expenditures]+[Row-3:Capital_expenditures])
ELSE 0
ENDIF

 

Expectation: First value should be against CQ42014 and this should be a result of ((CQ42014+CQ32014+CQ22014+CQ12014)- (CQ42013+CQ32013+CQ22013+CQ12013)).

 

My result expected differs from result received through the tool. Kindly guide me on this.

 

satya04_0-1681352545719.png

 

3 REPLIES 3
Yoshiro_Fujimori
15 - Aurora
15 - Aurora

@satya04 ,

I tried with the same input data and the same formula on my Designer, and the result is as below.

There might be something I don't see in your expected valuse. Could you share your workflow and input data?

 

PeriodCapital_expendituresResult
CQ12013-1267870
CQ22013-1290430
CQ32013-1435130
CQ42013-1503310
CQ12014-134739-557626
CQ22014-141234-569817
CQ32014-149263-575567
CQ42014-171490-596726
CQ12015-136787-598774
CQ22015-141869-599409
CQ32015-143717-593863
CQ42015-162633-585006
CQ12016-137292-585511
CQ22016-132448-576090
CQ32016-138953-571326
CQ42016-157283-565976
CQ12017-134575-563259
satya04
8 - Asteroid

@Yoshiro_Fujimori The solution is correct. I would need it to start from CQ42014. Is it possible to state that? I am unable to include it through the "Contain" function.

Yoshiro_Fujimori
15 - Aurora
15 - Aurora

Hi @satya04 ,

As the current [Period] field is difficult to use in IF statement, I would convert it to Date type.

 

Formula to convert [Period] to Date type

PeriodStartDate =

DateTimeParse(

  Right([Period], 4)

  + ToString(

      ToNumber(

        Substring([Period],2,1)) * 3 - 2)

,"%Y%m")

 

Formula in Multi-Row formula

IF [PeriodStartDate] < "2014-10-01" THEN 0
ELSE [Capital_expenditures]
+ [Row-1:Capital_expenditures]
+ [Row-2:Capital_expenditures]
+ [Row-3:Capital_expenditures]
ENDIF

 

Workflow

Yoshiro_Fujimori_0-1681357002254.png

Output

Yoshiro_Fujimori_1-1681357052871.png

 

I hope this may work for your case.

Labels
Top Solution Authors