Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Prachi_Pradip_Kulkarni
Contributor II
Contributor II

facing issues in including zero values with set expression

In dimension for showing trends of last 6 quarters, last 6 months and last 30 days according to dropdown selections, we have created a expression using pick and match and in measure we have used set analysis...we are getting correct data but for 2 quarters there is no data and we want that  zero data as well ....if we use if condition we are getting the required visualization but facing this problem with set analysis

dimension expression: = pick(match('$(vPeriod)','Monthly','Quarterly'','Daily'),RollingMonth,QT,RollingDate)

here vPeriod is variable whose values change according to dropdown selections ('Monthly','Quarterly','Daily') and Rollingmonth field contains last 6 months ,RollingDate field contains last 30 days and QT contains quarters

measure expression: (count(distinct {$<RED_FLAG ={1}>} [AT_PROJECTID] ))

if RED_FLAG=1 we want count of distinct PID's

Kindly provide any solution to include zero data points in chart

Thanks in Advance🙂

1 Solution

Accepted Solutions
Prachi_Pradip_Kulkarni
Contributor II
Contributor II
Author

Hi @brunobertels ,

Thank You for your reply

It isn't worked for me but I found one solution for this 

 

(count(distinct {$<RED_FLAG={1}>} [AT_PROJECTID] )) + Count(DISTINCT [AT_PROJECTID])*0

 

View solution in original post

4 Replies
brunobertels
Master
Master

Hi 

not sure but may be like this 

 

(

count(distinct {$<RED_FLAG ={1}>} [AT_PROJECTID] )

+0 * 

count( {1} distinct {$<RED_FLAG ={1}>} [AT_PROJECTID] )

)

 

Prachi_Pradip_Kulkarni
Contributor II
Contributor II
Author

Hi,

Thanks for reply ... with your solution we are getting data where we are expecting zero data for 2 quarters and getting unexpected high data for other 4 quarters as well

Kindly help!

brunobertels
Master
Master

ok 

Have you tried to agregate your mesure with aggr() function 

 

(

aggr(count(distinct {$<RED_FLAG ={1}>} [AT_PROJECTID] ),$(vPeriod))

+0 * 

aggr(count( {1} distinct {$<RED_FLAG ={1}>} [AT_PROJECTID] ),$(vPeriod))

)

Prachi_Pradip_Kulkarni
Contributor II
Contributor II
Author

Hi @brunobertels ,

Thank You for your reply

It isn't worked for me but I found one solution for this 

 

(count(distinct {$<RED_FLAG={1}>} [AT_PROJECTID] )) + Count(DISTINCT [AT_PROJECTID])*0