Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
nadkalyan
Partner - Creator II
Partner - Creator II

Help with chart design with total amounts

Hi,

I am designing a bar chart with 2 dimenions - 'Month' and 'Year' and expression as

(if(match(TripType, 'NONBILLABLE' ,'nonbillable'),

    sum({1}AirFareAmount)+sum({1}HotelBookedAmount)+sum({1}CarCostAmount))

    )

when I do this,I get chart with 'No Data to display'

So I added the 'TripType' dimension to chart and now i get chart values but not the chart I was intended to -

7-25-2012 10-01-23 AM.png

All I want to do is create a grouped chart by Months and Year and also chart is static no matter what other values in other list box (month or year) i select.

Can someone guide me on how to acheive this or if there is something wrong with my chart design.

Thanks

Kalyan

1 Solution

Accepted Solutions
Not applicable

8 Replies
Not applicable

Kalyan,

If statement is column level function not aggr function (ie., evaluates but not aggregates) hence you are not getting result unless TripType is added to dimensions.

{1} in set analysis indicates ignore all selections.

The expression you are looking for might be:

Sum({<TripType={'NONBILLABLE' ,'nonbillable'}>} AirFareAmount+HotelBookedAmount+CarCostAmount)

I think you have data only for Apr-2012 hence not able to see multiple bars (or selection is made).

Kiran.

nadkalyan
Partner - Creator II
Partner - Creator II
Author

Hi Kiran,

After using the expression you provided and still including TripType Dimension, It gives me "No data to display" in chart.

I tried removing TripType Dimension, but no luck.

Appreciate your suggestions. Any other?

Kalyan

Not applicable

Lets break one by one.

Create a text box with the below expression:

=Sum(AirFareAmount)+sum(HotelBookedAmount)+Sum(CarCostAmount)

Clear all selections and select 'NONBILLABLE' and 'nonbillable' in Triptype dimensions. We are trying to find it there is data at all for these triptype selections.

If this works add expression with previous set analysis into all these three sum functions, clear selections into the chart. If still doesnt work, there is some data issue and you may have to share your qvw.

Kiran.

nadkalyan
Partner - Creator II
Partner - Creator II
Author

Kiran,

I followed as per your instructions and did create a Text Box with Expression

=Sum(AirFareAmount)+sum(HotelBookedAmount)+Sum(CarCostAmount)

and I get Data without any filters.

Now i added Trip Type List Box and just selected 'NONBILLABLE' and 'nonbillable' only and see data for those selections too.

Now I added another TextBox with above Set analysis expression i get 0.

7-25-2012 1-34-21 PM.png

Attached is the QVW file.

Not applicable

Updated.

nadkalyan
Partner - Creator II
Partner - Creator II
Author

Thanks Kiran,

This now shows Amounts for 'NONBILLABLE' ,'nonbillable', but the Set Analysis seems to be not working, I want the chart to be static - to display all Years , months bars no matter what I select my Year and Month List boxes. Can this be acheived?

Kalyan

Not applicable

done.

Kiran.

nadkalyan
Partner - Creator II
Partner - Creator II
Author

Thanks Kiran, That works perfect. Although if I add any new List Boxes as filters, I guess i have add them to Set Analysis expression.

Kalyan