Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
greend21
Creator III
Creator III

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
Creator III
Creator III
Author

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

This works

View solution in original post

4 Replies
MK_QSL
MVP
MVP

Use something like below

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


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

greend21
Creator III
Creator III
Author

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

greend21
Creator III
Creator III
Author

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

This works

greend21
Creator III
Creator III
Author

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.