Hello All,
I have variable called currentQuarter have value =1 (can be anything between 1 to 4) now I need to add this inside the collection with number rows equal tp varQuarterCount i.e. 2 or can be more than 2.
I am using for all here , it is creating the collection having 2 rows but at the same time I want varCurrentQuarter value to be changed so I am also using If inside for all to increase/decrease value of varCurrentQuarter variable.
But Collection having two rows with same value of varCurrentQuarter = 1 instead it should be two in second row
Below is the formula which I am using:
If(Count Rows(collQuarterlyDetails)<varQuarterCount,
ForAll( Sequence( varQuarterCount ),
Collect(collQuarterlyDetails,{PlannedCost:0,BudgetedCost:0,ActualCost:0,Quarter:Concatenate("Q",Text(varCurrentQuarter))});
If(varCurrentQuarter = 4,
varCurrentQuarter-3,
varCurrentQuarter+1
)));

In second row of collection it should have Q2 instead of Q1 as Value is increasing inside for all for varCurrentQuarter variable.
If any one can help me to increase/decrease value of varCurrentQuarter variable inside for all based on if condition.