Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Talk to Experts, a LIVE Q&A Webinar. Bring your Qlik Sense Business questions on Aug. 4th. Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

Error in Expression ')' expected

I am using below expression for a count calculation, i have not missed any ')' and expression is working on some filters and throwing 'Error in expression ')'  in some cases, no idea on which basis

Here is the expression

Count(distinct if(Year=$(vLastYear) and Date <= $(vLastYTD) and (SubFlag = 'Custom_Req'  or SubFlag = 'Terminal_Req') and Flag_Filter = '0',VOYAGE_KEY1))

Any suggestions please?

Thanks,

Tags (1)
Labels (2)
6 Replies
Highlighted
Contributor
Contributor

Re: Error in Expression ')' expected

Hi,

Try this.

=Count(distinct if(Year=$(vLastYear) and Date <= '$(vLastYTD)' and
(SubFlag = 'Custom_Req' or SubFlag = 'Terminal_Req') and Flag_Filter = '0',VOYAGE_KEY1))

Highlighted
Specialist III
Specialist III

Re: Error in Expression ')' expected

Hi,

 

can you try with Set Analysis:

=Count(

{<Year={'$(vLastYear) '},Date={"<$(vLastYTD)"},SubFlag ={'Custom_Req','Terminal_Req'},Flag_Filter ={0}>}

Distinct VOYAGE_KEY1)

Thanks,

Mohammed Mukram

Highlighted
Contributor II
Contributor II

Re: Error in Expression ')' expected

Tried, it does not consider Date after applying and give full Year count, also after applying that error is still coming.

Highlighted
Contributor II
Contributor II

Re: Error in Expression ')' expected

Tried, it does not consider Date after applying and give full Year count, also after applying that error is still coming.
Contributor II
Contributor II

Re: Error in Expression ')' expected

@Mukram, In Set Analysis Date filter was not getting applied with
Date={"<$(vLastYTD)"} or Date={'<$(vLastYTD)'} and returning 0 so thats why i switched to if condition, if set analysis works with Date filter then it is best.

Thanks,
Highlighted
Specialist III
Specialist III

Re: Error in Expression ')' expected

Hi,

 

can you attach sample file.