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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
NavinReddy
Creator II
Creator II

expression error

Hello All,

Please help me, how can i get 3 months values using below expressions. below expression is not workign for me. kindly help me if any modification to the expression.

MonthName(Date) as Metric_Month
vMaxDate=monthname(addmonths(max(Date),0))
vMaxDate2=monthname(addmonths(max(Date),-2))

 

=Count(DISTINCT{<Month=,Metric_Month={">=$(=vMaxDate)<=$(=vMaxDate2)"}>}value_id)
&' ('&
num(num(Count(DISTINCT{<Month=, Metric_Month={">=$(=vMaxDate)<=$(=vMaxDate2)"}>}value_id)/
Count(DISTINCT{<Metric_Month=, Metric_Month={">=$(=vMaxDate)<=$(=vMaxDate2)"}>}Total <Metric_Month>value_id)),'###%')&')'


Thanks & Regards.
NR

1 Solution

Accepted Solutions
Kushal_Chawda

@NavinReddy  you can create synthetic data in excel with required output. But looks like your expression should be like below

=Count(DISTINCT{<Month=,Metric_Month={">=$(=vMaxDate2)<=$(=vMaxDate)"}>}value_id)

View solution in original post

5 Replies
NavinReddy
Creator II
Creator II
Author

Any suggestions please 

NavinReddy
Creator II
Creator II
Author

Any suggestions please 

Kushal_Chawda

@NavinReddy  can you share sample data with expected output?

NavinReddy
Creator II
Creator II
Author

Hi @Kushal_Chawda  , sorry for my late reply,  i have no access to share the sample data. 

i want to disply 3 months value trend using below expression and variables, any expression edits. 

variables:

vMaxDate=monthname(addmonths(max(Date),0))
vMaxDate2=monthname(addmonths(max(Date),-2))

Expression:

=Count(DISTINCT{<Month=,Metric_Month={">=$(=vMaxDate)<=$(=vMaxDate2)"}>}value_id)

 

Thanks & Regards,

NR

Kushal_Chawda

@NavinReddy  you can create synthetic data in excel with required output. But looks like your expression should be like below

=Count(DISTINCT{<Month=,Metric_Month={">=$(=vMaxDate2)<=$(=vMaxDate)"}>}value_id)