Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
durgabhavani
Creator III
Creator III

Can anyone help me to write expression?

Hi All,

My table contains two fields empname, dayscheck as below

empname
naresh
suresh
pavan kumar
satish
ramesh
swathi
amrutha

dayscheck
0-5 days
6-10 days
15+ days

I have dimension legend for employee name in piechart, now when i click on employeename it should show the "dayscheck" value related to "employee name" in below the chart.


I wrote below expression in chartproperties->presention->textinchart but not geting output as requested above.

=if(GetSelectedCount([empname]),[dayscheck]), 'ALL')  (Here 'ALL' denotes if nothing is selected then it should show ALL in below the chart)

Please advice me to write expression in chart?

This is highly appreciated.

Thanks,

Durga

8 Replies
danieloberbilli
Specialist II
Specialist II

Maybe like this:

=if(GetSelectedCount(empname)>0, 'DayCheck: '& Only(dayscheck),'')

PFA the qvw

senpradip007
Specialist III
Specialist III

PFA. Hope it will help.

durgabhavani
Creator III
Creator III
Author

Pradeep,

Can you please share the screen shots of expressions as i am unable to open .qvw files in office.

Thanks,

Durga

durgabhavani
Creator III
Creator III
Author

Thanks for response Daniel! Its almost working but small bug!

I wrote expression as count(dayscheck) and dimension as empname

i wrote your expression in "presentation" tab in "text in chart" field as below

=if(GetSelectedCount(empname)>0, 'DayCheck: '& Only(dayscheck),'ALL')

But i am not getting dayscheck values when clicking on particular empnames?

What might be the problem?

Please advice!

Thanks,

Durga

durgabhavani
Creator III
Creator III
Author

Please share screenshot daniel as before as i am unable to open .qvw files in office.

Thanks,

Durga

Not applicable

Hi

Check this image

157461 copy.png

try this expressions

Dimen :empname

Expression : Count(empname)

Not applicable

Hi,

You can try this,

In dimensions:

                 dayscheck

In expression:

             count(empname)

danieloberbilli
Specialist II
Specialist II

Maybe because you don't have distinct daycheck per empname.

If this is the case then try this: it concatenates all possible values and seperates them with a comma

e.g. like amrutha 0-5 days, 6-10 days:

=if(GetSelectedCount(empname)>0, 'DayCheck: '& Concat(dayscheck, ', '),'')