Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Data Load Editor Invalid Expression

Hi,

I am trying to use this expression in the data load editor to create a new table but I keep getting the invalid expression error.

If((1-(Sum(If(month= currentmonth, Spend))/Sum(If(month= currentmonth, Forecast)))) > .20, 'Red',

    If((1-(Sum(If(month= currentmonth, Spend))/Sum(If(month= currentmonth, Forecast)))) > - .20, 'Green')) as RAG

What would need to be changed to make this able to work.

Regards,

William

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I solved the issue by removing the sum from the expression.

Thanks.

View solution in original post

4 Replies
nehasaxena
Creator II
Creator II

Hi William,

Please share the complete load script for this expression. If you are using any aggregation function in script like Sum you need to do group by for all the fields that you are loading from the table.

BR,

Neha

jonathandienst
Partner - Champion III
Partner - Champion III

Remove the space between the - and the .20

If(1 - Sum(If(month = currentmonth, Spend)) / Sum(If(month= currentmonth, Forecast)) > .20, 'Red',

    If(1 - Sum(If(month = currentmonth, Spend)) / Sum(If(month = currentmonth, Forecast)) > -.20, 'Green')) as RAG

                                                                                                                                       ^^^

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
its_anandrjs

What error message you getting?

Try to write this way

If((1 - (Sum(If(month= currentmonth, Spend)) / Sum(If(month= currentmonth, Forecast)))) > 0.20, 'Red',

If((1 - (Sum(If(month= currentmonth, Spend)) / Sum(If(month= currentmonth, Forecast)))) > - 0.20, 'Green')) as RAG

Anonymous
Not applicable
Author

I solved the issue by removing the sum from the expression.

Thanks.