Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Conditional base requirement

hello everyone,

i have field like unit type having money ,volume,duration these are three which will be in this field,it is dimension filed and added like filter.

one more field balance in this values are getting group by unit type so now my requirement is if i click on volume it has to give value in mb

and if i click on amount it has show just sum of value and if it is the duration in has to show in min as we are getting data in minutes

my doubt is in one fild only all type of values iam getting so based on group it has to show values

for that i have given expression

=if(DIMENSION_FIELD2='MONEY',

num(sum(TOT_CALL_CHARGE),'##,##.##'),

if(DIMENSION_FIELD2='VOLUME',

num(sum(TOT_CALL_CHARGE/1048576),'###,##.##MB'),

if(DIMENSION_FIELD2='DURATION',

num(sum(TOT_CALL_CHARGE/60),'###,##')

)))

but it is not working

can any one help on the same please

thanks in advance.

2 Replies
pooja_prabhu_n
Creator III
Creator III

Hi,

You can try using GetFieldSelections function, when nothing is selected you can set it to some default format.

=if(GetFieldSelections(DIMENSION_FIELD2)='MONEY',

num(sum(TOT_CALL_CHARGE),'##,##.##'),

if(GetFieldSelections(DIMENSION_FIELD2)='VOLUME',

num(sum(TOT_CALL_CHARGE/1048576),'###,##.##MB'),

if(GetFieldSelections(DIMENSION_FIELD2)='DURATION',

num(sum(TOT_CALL_CHARGE/60),'###,##')

)))

sasikanth
Master
Master

Try this,

Create Inline table like below

Load * Inline [Unit,Deno,Sign

Single Unit,1,'$'

Thousands,1000,'$''000'

Millions,1000000,'$''m'

];


->Use always one selected value in Unit Filter

->Create a variable vDeno_Unit and use this in expression


Sum(TOT_CALL_CHARGE)/ $(vDeno_Unit)    // can enable based on condition



Above scenario is just an example for unit conversion similarly you can implement the same for your scenario too


Thanks,