Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

greend21
Contributor II

Variables within Set Analysis

I have the below measure in a chart. The vCollEff variable works fine WITHOUT the CE_AgeType expression in it. I am trying to get the second variable, vCEAgeType to work. If I test it as something similar in a Qlikview text box them the If statement works as expected. I am trying to use this to get my Qlik Sense chart to default to Bill Date as the CE_AgeType selection if nothing is selected and otherwise show the type that is selected. In theory I do not see why this wont work but I am thinking it could be the formatting of vCEAgeType within vCollEff. Any help is greatly appreciated!

IF([Amount/Count] = 'Count', Num(Sum($(vCollEff)CE0_30Cnt),'#,##0;(#,##0)'), Num(Sum($(vCollEff)CE0_30Amt)/1000000, '$###M;($###M)'))

vCollEff = {$<CEDateFlag = {1}, CE_AgeType = {'$(vCEAgeType)'},ReceiptType=,ReceiptStatus>}

vCEAgeType = If(IsNull(CE_AgeType), 'Bill Date', GetFieldSelections(CE_AgeType))

1 Solution

Accepted Solutions
greend21
Contributor II

Re: Variables within Set Analysis

vCollEff = {$<CEDateFlag = {1}, CE_AgeType = {'$(=$(vCEAgeType))'},ReceiptType=,ReceiptStatus>}

This works

4 Replies

Re: Variables within Set Analysis

Use something like below

vCEAgeType = IF(GetSelectedCount(CE_AgeType)=0,'Bill Date',GetFieldSelections(CE_AgeType))


vCollEff = {$<CEDateFlag = {1}, CE_AgeType = {'$(=vCEAgeType)'},ReceiptType=,ReceiptStatus>}

greend21
Contributor II

Re: Variables within Set Analysis

That does set the default to 'Bill Date' but the chart does not change as it should when I select other types.

greend21
Contributor II

Re: Variables within Set Analysis

vCollEff = {$<CEDateFlag = {1}, CE_AgeType = {'$(=$(vCEAgeType))'},ReceiptType=,ReceiptStatus>}

This works

greend21
Contributor II

Re: Variables within Set Analysis

Do you know how I could word this to get it to defualt to Bill Date and Effective date?

Using the following variable to have both selected did not work.

vCEAgeType = If(IsNull(CE_AgeType), 'Bill Date' and 'Effective Date', GetFieldSelections(CE_AgeType)) did not work.

Community Browser