Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can any one tell me what could be the error in using set analysis with multiple ifs..whenever i am using a set analysis statement individually, it is not showing any problem but whenever i AM TRYING TO USE IT FOR SEPARATE CASES its throwing error:
Garbage after expression ','
if (Match([Actual_Fuel_Type],'HSFO'), sum( total {$<Actual_Fuel_Type={'HSFO'}>}FUEL_MASS_BEFORE_SOUNDING/ 1000)),
if (Match([Actual_Fuel_Type],'LSDO'), sum( total {$<Actual_Fuel_Type={'LSDO'}>}FUEL_MASS_BEFORE_SOUNDING/ 1000)),
if (Match([Actual_Fuel_Type],'HSDO'), sum( total {$<Actual_Fuel_Type={'HSDO'}>}FUEL_MASS_BEFORE_SOUNDING/ 1000)),
if (Match([Actual_Fuel_Type],'ULSFO'),sum( total {$<Actual_Fuel_Type={'ULSFO'}>}FUEL_MASS_BEFORE_SOUNDING/ 1000)),'Unknown'))))
Note: Individual statements are working fine:
if (Match([Actual_Fuel_Type],'HSFO'), sum( total {$<Actual_Fuel_Type={'HSFO'}>}FUEL_MASS_BEFORE_SOUNDING/ 1000))
This is still working but its not working whenever I am using multiple case statements
I think you are closing all the if statement before the next one begins... try this
If(Match([Actual_Fuel_Type], 'HSFO'), Sum(TOTAL {$<Actual_Fuel_Type = {'HSFO'}>} FUEL_MASS_BEFORE_SOUNDING/1000),
If(Match([Actual_Fuel_Type], 'LSDO'), Sum(TOTAL {$<Actual_Fuel_Type = {'LSDO'}>} FUEL_MASS_BEFORE_SOUNDING/1000),
If(Match([Actual_Fuel_Type], 'HSDO'), Sum(TOTAL {$<Actual_Fuel_Type = {'HSDO'}>} FUEL_MASS_BEFORE_SOUNDING/1000),
If(Match([Actual_Fuel_Type], 'ULSFO'), Sum(TOTAL {$<Actual_Fuel_Type = {'ULSFO'}>} FUEL_MASS_BEFORE_SOUNDING/1000), 'Unknown'))))
I think you are closing all the if statement before the next one begins... try this
If(Match([Actual_Fuel_Type], 'HSFO'), Sum(TOTAL {$<Actual_Fuel_Type = {'HSFO'}>} FUEL_MASS_BEFORE_SOUNDING/1000),
If(Match([Actual_Fuel_Type], 'LSDO'), Sum(TOTAL {$<Actual_Fuel_Type = {'LSDO'}>} FUEL_MASS_BEFORE_SOUNDING/1000),
If(Match([Actual_Fuel_Type], 'HSDO'), Sum(TOTAL {$<Actual_Fuel_Type = {'HSDO'}>} FUEL_MASS_BEFORE_SOUNDING/1000),
If(Match([Actual_Fuel_Type], 'ULSFO'), Sum(TOTAL {$<Actual_Fuel_Type = {'ULSFO'}>} FUEL_MASS_BEFORE_SOUNDING/1000), 'Unknown'))))
Or try this
Pick(Match([Actual_Fuel_Type], 'HSFO', 'LSDO', 'HSDO', 'ULSFO') + 1,
'Unknown',
Sum(TOTAL {$<Actual_Fuel_Type = {'HSFO'}>} FUEL_MASS_BEFORE_SOUNDING/1000),
Sum(TOTAL {$<Actual_Fuel_Type = {'LSDO'}>} FUEL_MASS_BEFORE_SOUNDING/1000),
Sum(TOTAL {$<Actual_Fuel_Type = {'HSDO'}>} FUEL_MASS_BEFORE_SOUNDING/1000),
Sum(TOTAL {$<Actual_Fuel_Type = {'ULSFO'}>} FUEL_MASS_BEFORE_SOUNDING/1000))
Currently I used the following fixed code:
if (Match([Actual_Fuel_Type],'HSFO'), sum( total {$<Actual_Fuel_Type={'HSFO'}>}FUEL_MASS_BEFORE_SOUNDING/ 1000),
if (Match([Actual_Fuel_Type],'LSDO'), sum( total {$<Actual_Fuel_Type={'LSDO'}>}FUEL_MASS_BEFORE_SOUNDING/ 1000),
if (Match([Actual_Fuel_Type],'HSDO'), sum( total {$<Actual_Fuel_Type={'HSDO'}>}FUEL_MASS_BEFORE_SOUNDING/ 1000),
if (Match([Actual_Fuel_Type],'ULSFO'),sum( total {$<Actual_Fuel_Type={'ULSFO'}>}FUEL_MASS_BEFORE_SOUNDING/ 1000),'Unknown'
))))
But now I am having the following error:The records are duplicated
Do you have hidden dimensions in your chart?
Yah I created something fresh..Its working now...
Awesome, please close the thread by marking correct and helpful responses.
Best,
Sunny