Skip to main content

Hello!

I seem to face a problem when constructing a trial balance for which i use nested ifs. So the formula goes like this 

IF('GL Accounts'='GL Accounts'."Revenue" ,'Revenue Staging',IF('GL Accounts'='GL Accounts'."Other income" ,'Other Income staging'))

So the condition is different for each list item in GL Account dimension (Which has 40 items)

When we try to use the nested ifs, it doesn’t allow us beyond 17 loops. Cannot use the switch statement as we have a different criteria for each list item. 

Have you guys gone through such a situation and found an alternative to long nested loops?

Thanks in advance for your help!

Hello ​@Aravind !

If a SWITCH is not feasible (that would be the preferred option) what you could try is the following structure:

'Revenue Staging' gFILTER: 'GL Accounts'='GL Accounts'."Revenue" ] +
'Other Income staging' gFILTER: 'GL Accounts'='GL Accounts'."Other income"]

The example above should also work with SWITCH, but I’m unaware of any other conditions you might have but feel free to disclose them so we can review if using SWITCH is an option for your use case.


Thanks Stef for the fast response! Appreciate it!

Will try with switch and filter and post the result here.


It works. The arguments inside the switch metric must match that of the target metric. Thanks Stef!


Reply