Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
trishita
Creator III
Creator III

Syntax error with set analysis expression

Can anyone tell me what is wrong with my syntax here?

Only({$<Sounding Date -= {'N'}>} If([SOUNDING_START_DATE] >= [SURVEY_DATE] and [SOUNDING_START_DATE] < [SURVEY_DATE] + 7, 1, 0))

I have also added my qvw with this reference

15 Replies
tresesco
MVP
MVP

Couple of issues:

  • There is no field called 'Sounding Date' in your model. If you are wishing the expression label could be used in set analysis. You are wrong.
  • Had this even be a field, since there is space in between in the name, you have to enclose this field name within '[' and ']' or double quotes (" ")
trishita
Creator III
Creator III
Author

But I created an expression called Sounding Date:

Sounding date :

If(Flag1=1,Date(SOUNDING_START_DATE,'YYYY-MM-DD'), 'N')

So cant I use expressions in set analyisi

tresesco
MVP
MVP

No. That is what precisely I wrote in first point above. You have to use field instead in set analysis.

trishita
Creator III
Creator III
Author

I gave a flag called Flag1:

If([SOUNDING_START_DATE] >= [SURVEY_DATE] and [SOUNDING_START_DATE] < [SURVEY_DATE] + 7, 1, 0)

Then I created an expression:

Sounding date :

If(Flag1=1,Date(SOUNDING_START_DATE,'YYYY-MM-DD'), 'N')

Lastly I want to show the data for Sounding Date {$<Sounding Date -= {'N'}>}

which means I want to exclude out all date with value N and only display the values for Flag1=1

I dont know whats wrong with my method:

trishita
Creator III
Creator III
Author

So what could be a possible solution to only pick those data with flag1=1?

tresesco
MVP
MVP

Do you wish to suppress all the other rows from the chart ?

trishita
Creator III
Creator III
Author

yes i just want to show the data which has the value of flag 1.Something like this

tresesco
MVP
MVP

PFA

trishita
Creator III
Creator III
Author

I also tried to use a calculated dimension using If([SOUNDING_START_DATE] >= [SURVEY_DATE] and [SOUNDING_START_DATE] < [SURVEY_DATE] + 7, 1, 0) and then tried to supress null value from it..Still its not working