Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Solving the Informatica Dilemma: On-Demand Briefing - Watch On Demand!
cancel
Showing results for 
Search instead for 
Did you mean: 
Saritha077
Contributor II
Contributor II

Calculated dimension with multiple IF conditions

Hi All,

I am trying to create a calculate field based on multiple IF conditions in chart in dimension field.

I know we can create easily in script but i need to put in frontend.

If($(variable)<1, 'start',

  If($(variable)<2, 'End',

    If($(variable)<3, 'xyz',

       If($(variable)<4, 'middle','abc'))))

 

If $(variable) is 1, the field would return start but i need to display all values in chart 

start

end

xyz

middle 

abc

and measure is Sum(sales)

Please suggest me how can we create this in chart.

 

Thanks & regards,

Saritha.

Labels (1)
3 Replies
BrunPierre
Partner - Master
Partner - Master

Try this

=Only(Aggr(
If($(variable)<1, 'start',
If($(variable)<2, 'End',
If($(variable)<3, 'xyz',
If($(variable)<4, 'middle','abc'))))
,$(variable)))

avinashelite

For chart to show all values its better to create an inline load in the script and based on the condition you could calculate the value in the expression 

ali_hijazi
Partner - Master II
Partner - Master II

you can also add the five dimensions start, end,...
then in the Show dimension if : you put  $(variable)=1 for "start", $(variable)=2 for "end" , and so on

or as previously said:
you can create one calculated dimension as follows:
aggr(if($(variable)=1, 'start',if($(variable)=2, 'end')), $(variable))

but you are saying that you want to display all values?
can you elaborate more?

I can walk on water when it freezes