Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

taylor_jesse
New Contributor III

Calculated Dimension with Set Analysis

Hi

I have a set of data from 2015 to 2018 however I will like to create a calculated dimension for a chart that only displays data from 2016 to 2018 but I will also add a filter to the tab where the user can select to see the 2015 data if they want to just won't show in the chart as the default view.

Any help.

Thank you

1 Solution

Accepted Solutions
javierortiz79
New Contributor II

Re: Calculated Dimension with Set Analysis

The set Analysis will limit the dimension and the result to 2015 if selected or 2015,2016,2016, you don't need a calculated dimension.

put this in an expression.

=IF(GetSelectedCount(Year)>0,Sum({<Year = {'$(=Max(Year))'},metric_name={'Non-Billable Cost'}>} metrictotal)/sum(hours_units) , Sum({<Year = {'2016','2017','2018'},metric_name={'Non-Billable Cost'}>} metrictotal)/sum(hours_units))

27 Replies

Re: Calculated Dimension with Set Analysis

Let's talk in 2 tasks

I have a set of data from 2015 to 2018 however I will like to create a calculated dimension for a chart that only displays data from 2016 to 2018

Instead of creating dimension - I suggest you to restrict in expression

Sum({<Year = {2016, 2017, 2018}>} Sales)

but I will also add a filter to the tab where the user can select to see the 2015 data if they want to just won't show in the chart as the default view.

Not entirely sure, But whole expression should look like this

If(GetSelectedCount(Year)=0, Sum({<Year = {2016, 2017, 2018}>} Sales), Sum(Sales))

Life is so rich, and we need to respect to the life !!!
arunaerra
Contributor

Re: Calculated Dimension with Set Analysis

Hi

Add Calculated Dimension  like below

=if(Year>2015,Year)

jyothish8807
Honored Contributor II

Re: Calculated Dimension with Set Analysis

So if user select 2015 do you want to show sale from 2015 to 2018 ? or only 2015 ?

Br,

KC

Best Regards,
KC
shiveshsingh
Honored Contributor

Re: Calculated Dimension with Set Analysis

for you second requirement, you can create a separate chart and set the visibility like if  selected year = 2015, then show the chart with 2015 values.

jyothish8807
Honored Contributor II

Re: Calculated Dimension with Set Analysis

Try like this:

If(GetFieldSelections(Year)='2015',Sum({<Year = {2015}>} Sale), Sum({<Year = {2016, 2017, 2018}>} Sale))

Br,

KC

Best Regards,
KC
taylor_jesse
New Contributor III

Re: Calculated Dimension with Set Analysis

User can select 2015 data to view it but the default view when all selections are cleared should display data from 2016 to 2018.

taylor_jesse
New Contributor III

Re: Calculated Dimension with Set Analysis

Do you want me to try this as the calculated dimension to as an expressions for the chart?

Thank you

javierortiz79
New Contributor II

Re: Calculated Dimension with Set Analysis

Put this in an expression:

If(GetSelectedCount(Year)>0,Sum({<Year = {'$(=Max(Year))'}>} Sale) , Sum({<Year = {'2016','2017','2018'}>} Sale))

vijetasharma
Contributor III

Re: Calculated Dimension with Set Analysis

do you want particular chart to show default data 2016 to 2018 or whole dashboard?

If you want whole dashboard to show default data for 2016 to 2018 then you can apply document level trigger

or if you want for any particular chart then you can create two different calculated dimension one when user select any of the year then,

expression, sum(sale)

condition,GetSelectedCount(year)>0

and other expression should be,sum({<year={'2016','2017','2018'}>}sale)

condition,GetSelectedCount(year)=0

Community Browser