Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
=if(Activity_Code = 'LOADER',
(Sum({<Service_Type_Indicator = {FOM()'},OPS_Direction = {'EWF'}>}TEU) + (sum({<Service_Type_Indicator={FOM()'},OPS_Direction = {'EWF'}>}Transit_TEU) * 2))
/
(sum({<Service_Type_Indicator = {FOM()'},OPS_Direction = {'EWF'}>}Capacity) * 2)
* 100)
Hi does anybody know what is the problem with this code? My expression of the sum(TEU) is correct but however when i use if statement, it does not show.
For my other report, I can use if statement before fulfilling the sum expression.
I believe is a bug for this qlikview program somehow. Thanks anyone who can solve this problem
Hi
I think, you missed open quotes before FOM()?
=if(Activity_Code = 'LOADER',
(Sum({<Service_Type_Indicator = {'FOM()'},OPS_Direction = {'EWF'}>}TEU) + (sum({<Service_Type_Indicator={'FOM()'},OPS_Direction= {'EWF'}>}Transit_TEU) * 2))
/
(sum({<Service_Type_Indicator = {'FOM()'},OPS_Direction = {'EWF'}>}Capacity) * 2)
* 100)
And check
(sum({<Service_Type_Indicator = {'FOM()'},OPS_Direction = {'EWF'}>}Capacity) * 2) not an zero values?
this is my code. it does contain values. afterwhich i added a if statement as i need to eliminate certain records
=
if(Activity_Code = 'LOAD',
(Sum({<Service_Type_Indicator = {'EFE(MED)'},OPS_Direction = {'E'}>}TEU) + (sum({<Service_Type_Indicator={'EFE(MED)'},OPS_Direction = {'E'}>}Transit_TEU) * 2))
/
(sum({<Service_Type_Indicator = {'EFE(MED)'},OPS_Direction = {'E'}>}Capacity) * 2)
* 100)
HI
Can you provide a sample file?
Activity_Code contains "LOAD" or "Load", is there relation between Activity_Code and Dimension?
It helps for us.
What are the dimesions you have used?
Based on your expression Activity_Code should be specified in dimension.
If possible can you post sample app.
Hi Benn,
Not sure if this is the problem, added one extra bracket before multiplying with 100.
if(Activity_Code = 'LOAD',
((Sum({<Service_Type_Indicator = {'EFE(MED)'},OPS_Direction = {'E'}>}TEU) + (sum({<Service_Type_Indicator={'EFE(MED)'},OPS_Direction = {'E'}>}Transit_TEU) * 2))
/
(sum({<Service_Type_Indicator = {'EFE(MED)'},OPS_Direction = {'E'}>}Capacity) * 2))
* 100)
Rgds,
Abey
You formula can working depending how you use it.
Is it in the script ? a text-object ? a graph ?
My dimensions is just month year. I diden use activity code on my dimension.
Sent from my HTC
Then you should use aggr around that
=
Aggr(if(Activity_Code = 'LOAD',
(Sum({<Service_Type_Indicator = {'EFE(MED)'},OPS_Direction = {'E'}>}TEU) + (sum({<Service_Type_Indicator={'EFE(MED)'},OPS_Direction = {'E'}>}Transit_TEU) * 2))
/
(sum({<Service_Type_Indicator = {'EFE(MED)'},OPS_Direction = {'E'}>}Capacity) * 2)
* 100),Activity_Code)
this works but does this works the same as my previous code, as in the logic behind it.
Not well versed on aggr at the moment