Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I know from the backend that there will be 7 of these fields but could change to 8 , 9 ect the value vcount says the number
LET vcount = NoOfRows('Fields_Mapping'); // say its 7
if vcount is 7 you need to generate the string below that i can use on the front end
so im expecting let vMakeexpression=repeat().......smtng smnng to get the below string .
=if(not isnull([Checklist Phase 7]), [Checklist Phase 7],
if(not isnull([Checklist Phase 6]), [Checklist Phase 6],
if(not isnull([Checklist Phase 5), [Checklist Phase 5],
if(not isnull([Checklist Phase 4]), [Checklist Phase 4],
if(not isnull([Checklist Phase 3]), [Checklist Phase 3],
if(not isnull([Checklist Phase 2]), [Checklist Phase 2],
if(not isnull([Checklist Phase 1]), [Checklist Phase 1]
)))))))
Try this
LET vCount = NoOfRows('Fields_Mapping');;
Temp:
LOAD Concat(Temp, ',', -RowNo) & Repeat(')', $(vCount)) as String;
LOAD IterNo() as RowNo,
'If(not isnull([Checklist Phase ' & IterNo() &']), [Checklist Phase ' & IterNo() & ']' as Temp
AutoGenerate 1
While IterNo() <= $(vCount);
LET vMakeexpression = Peek('String');
Try this
LET vCount = NoOfRows('Fields_Mapping');;
Temp:
LOAD Concat(Temp, ',', -RowNo) & Repeat(')', $(vCount)) as String;
LOAD IterNo() as RowNo,
'If(not isnull([Checklist Phase ' & IterNo() &']), [Checklist Phase ' & IterNo() & ']' as Temp
AutoGenerate 1
While IterNo() <= $(vCount);
LET vMakeexpression = Peek('String');