Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
akpofureenughwu
Creator III
Creator III

Scripting Manipulation

Good day everyone

I am trying to write a script that will display a location status in text.

='Fish ' & (Sum({$<Centre = {'Jos'}>} CentreType) )

It gives me a error output not Retail... (This is wrong)

When I use a script to display the sales

='Fish ' & num(Sum({$<Centre = {'Jos'}>} [Fish Packs] ), '#,###.00' )

It gives me the correct output. The figure. (This is correct)

I need help with that script.

Thanks

See attached

1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi,

You cannot sum Text values.

Try this: ='Fish ' & (MaxString({$<Centre = {'Jos'}>} CentreType) )

Regards!

View solution in original post

4 Replies
Anonymous
Not applicable

Hi,

You cannot sum Text values.

Try this: ='Fish ' & (MaxString({$<Centre = {'Jos'}>} CentreType) )

Regards!

akpofureenughwu
Creator III
Creator III
Author

Thanks Manuel Capella. It worked.

I would like to add an indicator to the script.

Let's say 'Fish ' & (MaxString({$<Centre = {'Jos'}>} CentreType) )gives me a result Both.

Can I make the result behave as an indicator

Both... Green

Retail Yellow

Wholesales Brown

Thanks

Anonymous
Not applicable

You can use a Gauge Chart with Lights Style, on presentation use Single Light option.

Expression:

=IF(MaxString({$<Centre = {'Jos'}>} CentreType)='Both',0,

     IF(MaxString({$<Centre = {'Jos'}>} CentreType)='Retail',1,2))

Gauge Settings Min Value = 0 Max Value = 2

3 Limits, first Green Colour, second Yellow, and third Brown.

Regards!

Anonymous
Not applicable

Hi

If you need the " Text object " need to change the color as according the  your set analysis

1) create one variable in Variable Overview    like (Vcentre_type)(definition:=MaxString({$<Centre = {'Jos'}>} CentreType))

2)In the properties ...>Background..>color...>color area...>calcluated...

(use below one)

=if(Vcentre_type='Both',green(),if(Vcentre_type='Retail',yellow(),Brown()))