Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sorting and limiting bar chart

Dear All,

Please find attached a qvf, i which i want to limit the bars as below.

In Gross Margin bar chart

-> i want to show only those bars when its value is greater than 10%

-> want to Sort those bars by expression sum(Revenue) and llmit the bar nos to 2 only.

-> Dont want to use the filters, hence automatically wants to show the result for max(fmonthCD)

can you please guide here.

Sorting and limit.JPG

13 Replies
Not applicable
Author

Perhaps one of these posts could help?

Sorting issue in bar chart

Sorting issue

Not applicable
Author

i have tried , but its not working as per the requirement.

can you please check the attached qvf

Not applicable
Author

can somebody help me on this ?

Thanks

Prasanta

reddy-s
Master II
Master II

Hi Prasanta,

Yes its possible. The QVF you attached seems to be blank. Do i have created a barchart with the same issue.

Check the QVF:

Thanks,

Sangram

rbecher
MVP
MVP

Hi,

please find attached but I don't understand the last requirement. I use this measure:

sum({<Customers={"=sum(Activity1+Activity2+Activity3+alt(Pcost,0)+alt(Tcost,0))/sum(TOTAL Activity1+Activity2+Activity3+alt(Pcost,0)+alt(Tcost,0)) >= 0.1"}>}

Activity1+Activity2+Activity3+alt(Pcost,0)+alt(Tcost,0))/

sum(TOTAL Activity1+Activity2+Activity3+alt(Pcost,0)+alt(Tcost,0))

Had to use Alt() since due to NULL values in all rows Qlik Sense seems to have an issue to add them.

SortingTest.PNG

- Ralf

Astrato.io Head of R&D
Not applicable
Author

Hi Ralf.

thanks for your feedback. But still i am not getting the required result.

Please refer the attached qvf file.

In Gross Margin Bar graph, I want to show only 2 bars with below condition.

Gross margin value should be greater than 10% and the two bars should be ordered by sum(Revenue).

Which means out of the below bars shown in below picture, i just want to show the bars for customer - HP and Bharti.

Also the last condition, was if i can create a set analysis in my expression to pick the last month value as per column "fMonthCD" ! !

Srt issue.JPG

rbecher
MVP
MVP

But there are 4 bars over 10%. Do you want to show the top 2 bars?

Astrato.io Head of R&D
Not applicable
Author

yes only 2 bars whose gross margin is greater than 10% and has highest sum(revenue)

Not applicable
Author

formula for gross margin is

(sum(Activity1)+sum(Activity2)+sum(Activity3)+sum(Pcost)+sum(Tcost))/sum(Revenue)