Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have two charts, the 1st chart follows the selected dimension and the second chart's dimension will be other than selection
Below is the data, for some reason, the figure of quarterly is not the sum of monthly, and also yearly
The first chart will show the selected PERIOD_TYPE, and default to be monthly
On second chart, if the selected type is 'Monthly', it will show quarterly data 2016-Q1 and 2016-Q2; if the selected type is 'Quarterly', it will show the yearly figure. The problem is that if I selected 'Monthly', Qlik will filter out all 'Quarterly' dimension and thus show nothing.
PERIOD_TYPE | PERIOD_NAME | PERIOD_VALUE |
---|---|---|
Monthly | 2016-01 | 1 |
Monthly | 2016-02 | 2 |
Monthly | 2016-03 | 3 |
Monthly | 2016-04 | 4 |
Monthly | 2016-05 | 5 |
Monthly | 2016-06 | 6 |
Quarterly | 2016-Q1 | 8 |
Quarterly | 2016-Q2 | 20 |
Yearly | 2016 | 30 |
Load * Inline
[
PERIOD_TYPE,PERIOD_NAME,PERIOD_VALUE
'Monthly','2016-01',1
'Monthly','2016-02',2
'Monthly','2016-03',3
'Monthly','2016-04',4
'Monthly','2016-05',5
'Monthly','2016-06',6
'Quarterly','2016-Q1',8
'Quarterly','2016-Q2',20
'Yearly','2016',30
];
Filter Pane
Dimension
PERIOD_TYPE
Bar Chart 1
Dimension:
if (getSelectedCount(PERIOD_TYPE) = 1, PERIOD_NAME, if (PERIOD_TYPE = 'Monthly', PERIOD_NAME))
Measure:
Sum(PERIOD_VALUE)
Bar Chart 2
Dimension:
if (GetFieldSelections(PERIOD_TYPE) = 'Monthly',
if (PERIOD_TYPE = 'Quarterly', PERIOD_NAME),
if (PERIOD_TYPE = 'Yearly', PERIOD_NAME))
Measure:
Sum(PERIOD_VALUE)
Is this what you want?
If yes then you need to change the expression for your second chart to one of these based on your requirements:
=Sum({1}PERIOD_VALUE)
or
=Sum({<PERIOD_TYPE>}PERIOD_VALUE)
Assuming your first chart is working fine. Try including {1-$} to ignore selection (other than selection) in the second chart like:
Measure:
Sum( {1-$} PERIOD_VALUE)
Is this what you want?
If yes then you need to change the expression for your second chart to one of these based on your requirements:
=Sum({1}PERIOD_VALUE)
or
=Sum({<PERIOD_TYPE>}PERIOD_VALUE)
Thanks. This is what I need
Thanks, what is the difference between
Sum({1-$} PERIOD_VALUE)
and
Sum({1} PERIOD_VALUE)
{1-$} -> Show everything, but exclude current selections
{1} -> show everything regardless of any selection