Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Line chart selection issue

Hi all,

In a line chart, I have 3 lines with this expression:

Count({$<MillAlloc={"x"},AllocWeekYear={"<=$(vLastAllocWeek)"}, InternalServPfeYn={"N"},InternalServExternalPi={"N"},InternalServReadyLateDisp={"Y"}>}InternalServReadyLateDisp)

/(Count({$<MillAlloc={"x"},AllocWeekYear={"<=$(vLastAllocWeek)"}, InternalServPfeYn={"N"},InternalServExternalPi={"N"}>}InternalServReadyLateDisp))

Where x= ATF , SET or FIG.

I want to see them all when I enter the app, but then I may want to see just MillAlloc=ATF. But I'm can not do it. The other lines doesn't desappear… do you have any idea what can I do?

I cannot use MillAlloc as a 2nd dimension of my chart because I also need to draw a line that will be the average of all MillAllocs..

Thank you!

1 Solution

Accepted Solutions
sunny_talwar

I get it, may be this in that case

If(SubStringCount(Concat(DISTINCT '|' & MillAlloc & '|'), '|ATF|') = 1,

Count({$<MillAlloc={"ATF"},AllocWeekYear={"<=$(vLastAllocWeek)"}, InternalServPfeYn={"N"},InternalServExternalPi={"N"},InternalServReadyLateDisp={"Y"}>}InternalServReadyLateDisp)

/(Count({$<MillAlloc={"ATF"},AllocWeekYear={"<=$(vLastAllocWeek)"}, InternalServPfeYn={"N"},InternalServExternalPi={"N"}>}InternalServReadyLateDisp)))

Where GetFieldSelections only show a value when selected, Concat shows value even if you have no selected anything. So when you open your app, and have nothing selected this would work to show the expression

View solution in original post

8 Replies
sunny_talwar

May be check if ATF is selected or not...

If(SubStringCount('|' & GetFieldSelections(MillAlloc, '|') & '|', '|ATF|') = 1,

Count({$<MillAlloc={"ATF"},AllocWeekYear={"<=$(vLastAllocWeek)"}, InternalServPfeYn={"N"},InternalServExternalPi={"N"},InternalServReadyLateDisp={"Y"}>}InternalServReadyLateDisp)

/(Count({$<MillAlloc={"ATF"},AllocWeekYear={"<=$(vLastAllocWeek)"}, InternalServPfeYn={"N"},InternalServExternalPi={"N"}>}InternalServReadyLateDisp)))

Do the same for the other two

Anonymous
Not applicable
Author

I understand what you're trying to do but i didn't want to have the selection on a filter pane done when I open he sheet. Instead, I want the chart to display all lines, but to display only the line of the mill selected when I use the filter pane.

sunny_talwar

I get it, may be this in that case

If(SubStringCount(Concat(DISTINCT '|' & MillAlloc & '|'), '|ATF|') = 1,

Count({$<MillAlloc={"ATF"},AllocWeekYear={"<=$(vLastAllocWeek)"}, InternalServPfeYn={"N"},InternalServExternalPi={"N"},InternalServReadyLateDisp={"Y"}>}InternalServReadyLateDisp)

/(Count({$<MillAlloc={"ATF"},AllocWeekYear={"<=$(vLastAllocWeek)"}, InternalServPfeYn={"N"},InternalServExternalPi={"N"}>}InternalServReadyLateDisp)))

Where GetFieldSelections only show a value when selected, Concat shows value even if you have no selected anything. So when you open your app, and have nothing selected this would work to show the expression

Anonymous
Not applicable
Author

It's working! Thank you very much, Sunny!

Anonymous
Not applicable
Author

Hi Sunny,

Once again, thank you for your help yesterday.

I have a questions and I think you may help me… Before I start using that if expression, my chart was just showing values until de 48 week, as I define here: AllocWeekYear={"<=$(vLastAllocWeek)"} and the x axis have the same lenght. After added the if expression, the chart started displaying values only until that week but with the  x axis complete (empty from week 49 to 52). 

Do you have any idea to limit the x axis lenght until vLastAllocWeek? Thank you very much!

sunny_talwar

Add the same set analysis to the Concat function as well

If(SubStringCount(Concat({$<MillAlloc={"ATF"},AllocWeekYear={"<=$(vLastAllocWeek)"}, InternalServPfeYn={"N"},InternalServExternalPi={"N"},InternalServReadyLateDisp={"Y"}>} DISTINCT '|' & MillAlloc & '|'), '|ATF|') = 1,

Count({$<MillAlloc={"ATF"},AllocWeekYear={"<=$(vLastAllocWeek)"}, InternalServPfeYn={"N"},InternalServExternalPi={"N"},InternalServReadyLateDisp={"Y"}>}InternalServReadyLateDisp)

/(Count({$<MillAlloc={"ATF"},AllocWeekYear={"<=$(vLastAllocWeek)"}, InternalServPfeYn={"N"},InternalServExternalPi={"N"}>}InternalServReadyLateDisp)))

Anonymous
Not applicable
Author

Thank you Sunny!

I've just added this expressions AllocWeekYear={"<=$(vLastAllocWeek)"}, otherwise I couldn't see only one MillAlloc again, as I may want to.

Thanks a lot for your help!

sunny_talwar

Awesome