Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

Help with Line Chart

Hi all,

i need some help getting a line chart to work as needed.

I have a dimension of LeadTime (1-10) and a measure of Sum(Sales), i need it to be accumulated, so i am using the RangeSum function. so my full measure is..

RangeSum(

Below(

Sum({$<LeadTime={"<=$(vLeadTime)"}>}

Sales),

0,

NoOfRows())) !

what i want is for the measure to remain the same when a user selects a lead time. so currently, if i dont select a lead time, my chart goes to 1.6k. if i then select a lead time of 5, the chart changes to show around 750. i still want to see the 1.6k but i just want the dimension values to change to only show 0-5.

so basically i just want the chart to zoom in on the selections but still see the original value.

does that make sense?

i have attached a sample QVF.

1 Solution

Accepted Solutions
sunny_talwar

Try this

RangeSum(

Below(

Sum({<LeadTime>}Sales),

0,

NoOfRows()))

* Avg({$<LeadTime={"<=$(vLeadTime)"}>}1)

View solution in original post

7 Replies
sunny_talwar

Try this

RangeSum(

Below(

Sum({<LeadTime>}Sales),

0,

NoOfRows()))

* Avg({$<LeadTime={"<=$(vLeadTime)"}>}1)

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi Sunny,

thanks very much, is there a way to hide the unwanted dimension values?

sunny_talwar

Uncheck 'Include zero values' under Add-ons -> Data handling

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

thanks for your help once again

Anonymous
Not applicable

Bit unrelated but curious to know what '* Avg({$<LeadTime={"<=$(vLeadTime)"}>}1)' this part of the function doing?

sunny_talwar

Since we are ignoring selection in LeadTime field in the main expression so that we can have accumulation beginning from the start rather than restarting it based on the selection. We somehow need to remove the data which is not true based on the set analysis. By using this expression, we are saying that where ever the set analysis condition is true, we will have 1, else 0. So, essentially, we are zeroing out the unwanted data to just show the line for LeadTime greater than selected LeadTime.

Does it make sense?

Anonymous
Not applicable

yeah understood more clearly when tried it myself!

Nice trick.