Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
One of my KPIs displays one of 2 values dependent on whether the user has clicked on "Import" or "Export" (see variable vImportsExportsView)
= if ($(vImportsExportsView) = 1,
//IMPORT i.e. Source NOT Cyprus
count({<[Source_Region]-={'Cyprus'}>} AWB)
,
// EXPORT i.e. Source = Export and Destination NOT Cyprus
count({<[Source_Region]={'Cyprus'}, [Destination_Region]-={'Cyprus'}>} AWB)
)
In one of my tabs I want to offer them a button (to switch between Import/Export) and I am not sure what "Actions" I need to define to achieve the above.
With "Export" it's easy because I define "Select in field"
Field = Source_Region
Search String = if ($(vImportsExportsView) = 1, 'Cyprus', '')
Not sure how to handle:
Field = Destination_Region
Search String = ???
which also applies to "Import"
Any ideas or suggestions??
Thanks
Alexis
Not sure, but what if you do this via a variable.
Set a variable (named vVar) using the following expression -> If(vVar = 1, 0, 1)
and then use this expression:
If(vVar = 1, count({<[Source_Region]-={'Cyprus'}>} AWB), count({<[Source_Region]={'Cyprus'}, [Destination_Region]-={'Cyprus'}>} AWB))
Hi,
this solution will work.
Just a remark to the toggling of the vVar from 0 to 1.
This Expression is shorter:
$(vVar) BITXOR 1
Also if you have only 0 and 1 you could use instead of:
If(vVar = 1, count .... )
and
If(vVar, count ...)
You'll save some CPU Cycles.
Best regards,
Christian
Hi Sunny
Thanks for the reply.
Yes I agree this will work fine - it's just that I want these selections to be shown on the Source/Destination drop down listboxes that are been displayed.
regards
Alexis
You can learn about search strings at this place more than any other place: Compound Search - demystified