Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am try to do custom report as (https://community.qlik.com/t5/Qlik-Design-Blog/Qlik-Sense-Custom-Report/ba-p/1471797) and count total row for each dimension what I select. I stuck to calculate it.
Could you please help/suggest to resolve this issue?
Thanks,
Adam
Hi!
I suppose that you whant to fill the KPI Objects but I dont know how you want to fill them.
On the first hand
IF(GetSelectedCount(Dimension)='Address',
count({<Address=-{''}>}DimensionNo))
GetSelectedCount returns an integer with count of selections made in the field Dimension (so it will never be equal to 'Address'). If you want to count addresses when 'Address' record of the field 'Dimension' is selected, then try something like
If(Index(GetFieldSelections(Dimension, '|'), 'Address'), Count(Address))
Regards,
Jaime.
Hi!
I suppose that you whant to fill the KPI Objects but I dont know how you want to fill them.
On the first hand
IF(GetSelectedCount(Dimension)='Address',
count({<Address=-{''}>}DimensionNo))
GetSelectedCount returns an integer with count of selections made in the field Dimension (so it will never be equal to 'Address'). If you want to count addresses when 'Address' record of the field 'Dimension' is selected, then try something like
If(Index(GetFieldSelections(Dimension, '|'), 'Address'), Count(Address))
Regards,
Jaime.
On the other hand, check your syntax:
IF(GetSelectedCount(Dimension)='State' or 'Address' or 'Age' or 'Email Address' or 'Job Title' ,Count(DimensionNo))
The above expression is incorrect, 'or' does not work this way. You should have write
IF(GetSelectedCount(Dimension)='State' or 'GetSelectedCount(Dimension)=Address' or 'GetSelectedCount(Dimension)=Age' or 'GetSelectedCount(Dimension)=Email Address' or 'GetSelectedCount(Dimension)=Job Title' ,Count(DimensionNo))
Jaime.
Hi Jaibau,
Thank for your quickly respond. For the If(Index(GetFieldSelections(Dimension, '|'), 'Address'), Count(Address)) is correct..
The second not function. I want to count like first one but with multiple selection. For example, i select "Age" and "Address".
If(Index(GetFieldSelections(Dimension, '|'), 'Age'), Count({<Age=-{''}>}Age),0) + If(Index(GetFieldSelections(Dimension, '|'), 'Address'), Count({<Address=-{''}>}Address),0)
It there any way to simplify this syntax?
If(Index(GetFieldSelections(Dimension, '|'), 'Address'), Count({<Address=-{''}>}Address),0) +
If(Index(GetFieldSelections(Dimension, '|'), 'Age'), Count({<Age=-{''}>}Age),0) +
If(Index(GetFieldSelections(Dimension, '|'), 'Email Address'), Count({<EmailAddress=-{''}>}EmailAddress),0) +
If(Index(GetFieldSelections(Dimension, '|'), 'Job Title'), Count({<JobTitle=-{''}>}JobTitle),0) +
If(Index(GetFieldSelections(Dimension, '|'), 'State'), Count({<State=-{''}>}State),0)
Hi
I've been thinking for a while on how to simplify this expression but i dont' see a beautiful way to solve it!
Jaime.
Hi,
Thank for your help Jaime.