Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Scatter chart with parameters specified in table in the script

Hi everybody,

I've got a load * inline instruction which created a table :

load * inline [

State,X,Y,Expression

France,1,1,Sum({$<Flag_France={'1'}>}Population)

Spain,1,2,Sum({$<Flag_Spain={'1'}>}Population)

Italia,1,3,Sum({$<Flag_Italia={'1'}>}Population)

];

This table contains 4 parameters I need to create a scatter chart :

StateXYExpression
France11Sum({$<Flag_France={'1'}>}Population)
Spain12Sum({$<Flag_Spain={'1'}>}Population)
Italia13Sum({$<Flag_Italia={'1'}>}Population)

In properties I specified State on the Dimension Tab, Sum(X) to the x axis, Sum(Y) to the y axis and Sum(Expression) to the bubble size expression on the expression tab.

I think expression cannot be correctly read, because bubbles are visible but they doesn't return the right result. 3 bubbles are the same size and returns 0.

I've try de put the pick expression in expression like this : pick('$1',Sum({$<Flag_France={'1'}>}Population)) and put Sum($(Expression)) to bubble size but it returns 0.


Doas anyone could help me to find the right syntax ?


Regards,


Marine Le Trionnaire

4 Replies
Gysbert_Wassenaar

See this discussion: Expressions in Fields


talk is cheap, supply exceeds demand
Not applicable
Author

Hi,


It's OK if I use this :

if(

       State = 'France', Sum({$<Flag_France={'1'}>}Population),

            if(

               State = 'Spain', Sum({$<Flag_Spain={'1'}>}Population),

                 if(

                    State='Italia', Sum({$<Flag_Italia={'1'}>}Population)

                 )

            )

  )

Or if I created 3 variables(FrancePopulation,SpainPopulation,ItaliaPopulation) in the script for the 3 expressions I can use :

if(

       State = 'France',$(FrancePopulation),

            if(

               State = 'Spain', $(SpainPopulation),

                 if(

                    State='Italia', $(ItaliaPopulation)

                 )

            )

  )


But the only function couldn't be use in a scatter chart.

The expression is ok in a text box but there is a problem in a graph because bubbles are the same sizes.


if(

       State = 'France', only({<ID={1}>}Expression1),

       if(

          State = 'Spain', only({<ID={2}>}Expression2),

            if(

               State ='Italia', only({<ID={3}>}Expression3)

            )

       )

  )

Regards,

Marine Le Trionnaire

Gysbert_Wassenaar

I think that's because you don't dollar expand it. Try:


if(

       State = 'France', $(=only({<ID={1}>}Expression1)),

       if(

          State = 'Spain', $(=only({<ID={2}>}Expression2)),

            if(

               State ='Italia', $(=only({<ID={3}>}Expression3))

            )

       )

  )


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks to your answer.


I tried the expression in scatter chart and in a text box.

This expression (=only({<ID={1}>}Expression1)) is Ok in a text box but it doesn't return the right value in the chart.

I wonder if it's not because in table there are several informations and may be only one information can be returned in this chart. This is the reason why it's ok when i'm using variables but it could be easier with a table which contains all expressions I need.


Regards,

Marine Le Trionnaire