Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
CUSTOMERS ONLY: Now accepting customer applications for the 2023 Luminary Program: SUBMIT NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Change line chart style interactively (remove dimension)

Hi all,

this is my data:

Country

MonthItemsSold
1Jan12
1Feb15
1Mar17
1Apr3
1May17
1Jun18
2Jan15
2Feb17
2Mar19
2Apr16
2May18
2Jun12

I show this data in a line chart. Month and Country are the dimension, ItemsSold is displayed on the y axis (accumulated).

Now I am looking for a way to change the style of the line chart so that the country dimension is somehow removed and the ItemsSold of all countries get accumulated per month, e.g. for January, the values shown in the graph should be 27, instead of 12 and 15.

1. How can I define to accumulate per month?

2. Is there a way to let the user interactively switch between these two styles?

Thank you,

Christian

7 Replies
Anil_Babu_Samineni

PFA, and let me know your expected o/p?

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Not applicable
Author

Sorry, I can't open the attached file (QVPE). Can you please describe what to do or provide a link where it is explained how to implement the functionality described in my question?

Thank you

ecolomer
Master II
Master II

See this file

P_231439.png

Is you need?

effinty2112
Master
Master

Hi Christian,

                         You can remove and restore the country dimension easily to your chart. Make the dimension conditional on a variable, say vShowCountry. Create this variable in Variable Overview (via Settings) and set it equal to 1. In the Dimensions tab set the Enable condition for the Country dimension:

Dimension.jpg

Add a button and set its text in the General tab:

Button.jpg

Add an action to set the value of the vShowCountry variable:

Variable.jpg

That should do it. You should see something like:

Hide.jpg

Click the button and you should then see:

Show.jpg

Kind regards

Andrew

Not applicable
Author

Hi Andrew,

thank you, this is exactly what I need. I tried and it worked immediately with my data.

Now I have a bonus requirement:

I need to show the y-axis in relativ mode, i.e. 0-100%.

With the setting as in your example, the values add up to 100% when there is only one line, i.e. country is removed from dimension.

If there are separat lines for each country, each line only goes up to the percentage which reflects the ration of items sold in this country compared to the overall items sold.

Is there a way to scale each of the separat lines, so that every one of the goes up to 100%?

In fact, what I want to have is an empirical distribution function (Empirical distribution function - Wikipedia, the free encyclopedia), similar to what is shown in this picture (complete different data, just to show an example).ecdf_plot_from_grimson_et_al.png

Thanks a lot,

Christian

effinty2112
Master
Master

Christian,

               Is this what your'e looking for? Use the expression given in the legend and in the expression tab select Full Accumulation. You can tidy it up a little by setting the Static Max to 1 in the Axes tab.

The TOTAL qualifier disregards any chart dimensions except any listed in the <>. In this case

Sum(TOTAL <Country> ItemsSold)

is a constant value for each month : the total number of Items sold in a country over all months. As the numerator accumulates to this figure for successive months the ratio approaches unity.

Regards

Andrew

Cumchart.JPG

Not applicable
Author

Andrew,

yes, this is exactly what I need. I guess in the TOTAL <>, I can also use multiple columns, in case that my original second dimension is not only country, but country & product, or any other combination?

Thank you very much,

Christian