5 Replies Latest reply: Feb 19, 2015 1:38 AM by Ashish Tuti

# Conditional dimension in Sense

Hi Everyone,

Im working on my Qlik Sense project and needed some guidance.

I have 4 Columns in my data:

 S/N Number Status Period a1 15 Open 41609 a1 16 Lost 41609 a2 15 Won 41334 a2 17 Won 41334 b1 15 Open 41395 b1 18 Won 41395 c1 15 Open 41275

Now I need to create a chart that will count the number of S/N in a month, but the condition being that every month(the month is in Period, which i will later convert using Date()) will have two entries, one for first half denoted by 15 in "Number" and one in second half denoted by any "Number" greater than 15(16, 17, 18). Now the count should be only for the latest period ie second half("Number" greater than 15), unless the date selected is less than 15(this again im implementing through a Master Calendar).

Im unable to form the right expression for it, having tried the condition in Conditional Dimension and Measure, any guidance will be greatly appreciated.

• ###### Re: Conditional dimension in Sense

Hi

I have not tried it. Can u try with this expression

=count(

\$(=

if(

day(date(period)) < 15, '{< Number = {15} >}' , '{< Number -= {15} >}' ,

)

)

S/N)

• ###### Re: Conditional dimension in Sense

Thanks for your response Ashish, but the chart isn't displaying anything after i implemented the expression, something i've faced with most of the expressions so far.

• ###### Re: Conditional dimension in Sense

Its working for me. Just there is a slight modification in expression. Also please check the casing of each fields.

count(

\$(=

if(

day(date(Period)) < 15, '{< Number = {15} >}' , '{< Number -= {15} >}' ,

)

)

[S/N])

• ###### Re: Conditional dimension in Sense

Great Ashish, it worked..... Just one question, does "-=" work as a logical NOT EQUAL in all cases....?

• ###### Re: Conditional dimension in Sense

yes -= works as not equal, it will consider all values of a set/field other than values you have given in modifier