Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
muhammadasfand
New 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,

Labels (3)
6 Replies
ahmetozsari
New 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))

mdmukramali
Valued Contributor 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

muhammadasfand
New 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.

muhammadasfand
New 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.
muhammadasfand
New 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
mdmukramali
Valued Contributor III

Re: Error in Expression ')' expected

Hi,

 

can you attach sample file.