Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to show total bar as first bar in bar chart in qlikview

how to show total bar as first bar in bar chart in qlikview?

34 Replies
Kushal_Chawda

Have you tried my solution?

Not applicable
Author

I added one column F0 and selecting value from F0. Its there in your last attached qvw

Not applicable
Author

I have tried but I dont understand how pick is working using dim. why only two values (1,2) in dim?

sunny_talwar

He is just creating a island table which isn't connected to any other table in your database (so it won't filter 'Total' out because there is no relation with the other fields) and Pick is doing the following:

=Pick(Dim,'Total',F1) -> If(Dim = 1, 'Total', F1)

Pick is a nicer and cleaner way of writing an if statement.

Kushal_Chawda

Pick is having two values (1,2) which is used to Pick actual values

So, 1 will show 'Total'

      2 will show all F1 values

So, Pick(Dim,'Total',F1) means First Display 'Total' (1) & then F1(2) Values in Dimension.

sunny_talwar

Try this:

If(Only({1}F1) = 'Total', (Sum({1<F2 = p(F2)>}TOTAL F2) - 8), Sum(F2))

Capture.PNG

Not applicable
Author

Thanks. Its working. Can you explain me about logic?

sunny_talwar

Will try to break down the expression for you


Only({1}F1) -> Look at all F1s and ignore any selection made in the database ({1})

Sum({1<F2 = p(F2)>}TOTAL F2) -> Sum(TOTAL F2) but sum only those F2s which are available to be selected (F2 = p(F2)) and ignore any other selection.

Rest of the expressions should be pretty straight forward.

Best,

Sunny

Not applicable
Author

Ok, Thanks. But when I select A in F0, I got 2,3,4 in F2 so If I add it will be 9 then subtract 8 will be 1 but in chart It is showing 11.

How?

sunny_talwar

I complicated the expression for no reason. Check this out:

If(Only({1}F1) = 'Total', (Sum(TOTAL F2) - 8), Sum(F2))

Capture.PNG