Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create a Chart using calculated item

Dear all,

Is it possible to create a chart to count how many times appear of a calculated item? I tried but unable to do so.

For example:
error loading image

Any suggestion?

Thanks

1 Solution

Accepted Solutions
deepakk
Partner - Specialist III
Partner - Specialist III

hi,

PFA.

I hope the attachment helps you out.

View solution in original post

7 Replies
deepakk
Partner - Specialist III
Partner - Specialist III

hi,

Yes its possible. ONe of the way of doing it is creating a field at script level.

if((count) <= 5 , 'Low usage' ,if(count > 5 and count < 20 'Mid USage', if(count >20, 'High Usgae'))) as Calculateditem,

Now in Fron end add the two dimension COuntry and Calculateditem and in expression count( Calculateditem ).

I hope this helps.

Not applicable
Author

Hi Deepak,

Thanks for your suggestion. But I do not want this to put into the loading scripts because the data consists of 2 years data in transaction level and thus, the number of count is also a calculated item as well. In QV, will have a selection page for users to choose whether they want to see the monthly, bi-monthly, quarterly, yearly, etc. Hence, pre-calculate in the scripts does not work.

I want the chart can be dynamically change based on the users' choice in selection page.

Thanks

deepakk
Partner - Specialist III
Partner - Specialist III

hi,

PFA.

I hope the attachment helps you out.

Not applicable
Author

[View:http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/7823.Test222.zip:550:0]

Hi Deepak,

Thanks a lot and it works.

Moreover, I added more data, country field as well, to your qvw file and plot a chart as attached.

I found that since there are too much values on the x-asis, the chart is unable to show all the country and thus, it hided some of them. I would like to ask

1) You can see that even there is no staff in AU for Prod A, but the chart still having AU in A. Can I remove all the value in X-asis which is not exists to the specific Prod. For example, I just want to show CN, ID and IN for Prod D.

2) If 1 cannot be done, then will face another problem is not all the countries are shown in the chart. For example, CN label in x-asis is missing but the CN bar is there. This will confuse users. What should have do in order to show all?

Thanks

deepakk
Partner - Specialist III
Partner - Specialist III

hi,

I saw the application , I am not able to figure out the first problem. The second one can be resolved by reducing the font size of to X size.

Not applicable
Author

I don't think there is an option to hide the Country's with no Counts. What you could do is create a Calculated Dimension as '=Prod & Country'. This will collapse the grouping into a single layer and will chart appropriately. A (possible) downside is the unfriendly labels.

Not applicable
Author

Thanks Jamie.

That's no good. But it is weird that in pivot format, it shows in a perfect way while in chart is not.

I think QV has to look at this.