Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
LINKEDIN LIVE: Democratizing data to enhance customer-centricity. JULY 29TH REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Multiple Expressions on a Chart

Hello,

I have a requirement. Can we have multiple expression on a chart. I know we can create a line table and use conditional show/hide in expressions, but my requirement is user wants to select more than one expressions.

for e.g: I have a line chart. my Dimension is Month and i have these expressions

1) Cost

2) Revenue

3) Volume

4) Sales.

Now, the user wants to select any one expression at a time or all expressions at a time from a single list box.

Can we achieve this?

Thanks for you help

Vani

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

13 Replies
its_anandrjs

Yes you can do this by creating a Inline table like

Dimension

LOAD * Inline

[

DimensionName

Cost

Revenue

Volume

Sales

];

and in your straight table chart or any chart in chart properties -> Expresions -> select conditional by tick mark and paste condition like

For

Cost->  if(DimensionName='Cost',1,0)

Revenue->  if(DimensionName='Revenue',1,0)

Volume->  if(DimensionName='Volume',1,0)

Sales->  if(DimensionName='Sales',1,0)

Hope this helps

Thanks & Regards

its_anandrjs

Check attached snap shot for this

Dimselection.png

Hope this helps

Thanks & Regards

Not applicable
Author

Thanks Anand.  But with this I can only select one value from the DimensionName at any time. My user would like to have the ability to select multiple DimensionNames at a time.

Thanks,

Vani

Not applicable
Author

A few things to keep in mind.

The solution provided by Anand is available in QV11.

If you are using QV10 you have to use Properties > Presentation > Conditional option.

This is not ideal though because this doesn't remove the expression, just simply hides it but in the background its still in the table just not visible to the user.

Else you have to overlay multiple charts over each other and use conditional show. This is a night mare.

jsaradhi
Specialist
Specialist

modify the conditions to something like

DimensionName like '*Cost*'

this will return true for multiple selections. you do not need the if(expression,1,0) as the expression in a conditional input field will return boolean anyway.

jerem1234
Specialist II
Specialist II

If you want to be able to select multiple you may also try in the conditional:

substringCount(concat(distinct Dimension), 'Cost')

OR

match('Cost', $(=concat(distinct chr(39) & Dimension & chr(39), ',')))

You may replace concat() with GetfieldSelections() if you wish.

Hope this helps!

Not applicable
Author

Here is the chart that I have. Here I have Revenue and Volume which are always static. Above this chart is a list box which has multiple values (I used line table to create these). From this list box I can select only one value at a time and the chart will add one more line. But i would like to have the ability to select two or more values at a time. then there will be multiple lines in chart depending on the how many selections I did.

Capture.PNG.png

Capture1.PNG.png

Thanks

jsaradhi
Specialist
Specialist

jerem, i always wondered if your method is better than the simple "like" comparison that i have been using now? i would like to use the method you suggested if it is better than the one i use performance wise.

MK_QSL
MVP
MVP