Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

manojkumargowda
New Contributor III

getfieldselections in calculated dimension

Hi All,

I have 2 month fields, one is created month and the other is due month.  I have a list box which shows created month and a bar graph with sum(sales) in y axis and due month in x axis.

Now what I need is, my bar graph should show only for months (due month), for which user selects in list box (created month). How can I achieve this using getfieldselections(created month)

1 Solution

Accepted Solutions
sunilkumarqv
Valued Contributor II

Re: getfieldselections in calculated dimension

hopes this will helps you

if(getselectedcount(due month)>0,if(due month=created month,due month))

10 Replies
sunilkumarqv
Valued Contributor II

Re: getfieldselections in calculated dimension

Please try below

if(Getselectedcount(Created month)>0,[due month],[created  month])

or

if(Getselectedcount(Created month)>0,[due month],'No Dimension')

manojkumargowda
New Contributor III

Re: getfieldselections in calculated dimension

Hi Sunil,

This is not what I wanted. If a user selects January and march in list box (created month), bar graph should show only for January and march (due month).

bwisealiahmad
Valued Contributor

Re: getfieldselections in calculated dimension

Another suggestion is:

Sum({<[CreatedMonth] = {'$(=GetFieldSelections([CreatedMonth]))'}>}Sales)

And you use DueMonth as Dimension.

Good luck!

agigliotti
Honored Contributor II

Re: getfieldselections in calculated dimension

maybe for your bar chart dimension you could use:

if( [due month] = [created month], [due month] )

and untick "Include null values"

I hope it helps.

manojkumargowda
New Contributor III

Re: getfieldselections in calculated dimension

Hi Ali,

Measure is fine. I don't want to put any filter in that. Instead of showing all the values of created month in bar graph, I just want to show only selected (through list box) due month.

Hope I made my question clear.

bwisealiahmad
Valued Contributor

Re: getfieldselections in calculated dimension

Maybe you could share an example?

From what I understood you want to show some measure for the DueMonths? And the DueMonths you show is based on which CreatedMonth are selected?

sunilkumarqv
Valued Contributor II

Re: getfieldselections in calculated dimension

hopes this will helps you

if(getselectedcount(due month)>0,if(due month=created month,due month))

MVP
MVP

Re: getfieldselections in calculated dimension

May be try this

Sum({<[due month] = p([created month]), [created month]>}sales)

balabhaskarqlik
Honored Contributor

Re: getfieldselections in calculated dimension

May be these:

=Sum({$<[Due Month] = {'$(=GetFieldSelections([Created Month]))'}>}Sales)

=Sum({$<[Due Month] = p({<[Created Month]=>})>}Sales)