Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Need help in expression

Hi,

I had written one expression, but it is showing invalid data. in expression it is ok, but some where it is going wrong.

Pls see the screen shot and help me on this.

Regards,

Kumar

33 Replies
Anonymous
Not applicable
Author

I suppose that Date is a built-in function and requires some parameter

did you mean [Time Full Date]={"$.....)??

what do you mean in Expression okay??

jonathandienst
Partner - Champion III
Partner - Champion III

Its a lot easier if you post the text rather than an image, but you need:

     [Site Visit Hit Source] -= {5, 7, 8, 9}, ....

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Hi,

Pls find the expression.

=count(DISTINCT{$<[Site Visit Hit Source]={"<>5,7,8,9"}, [Site Visit Post Page Event] = {0}, Date={"$(=max(Date([Time Full Date],'MM/DD/YYYY'))-30)"}>} [Visitor ID])

Anonymous
Not applicable
Author

Hi Kumar,

what you want to achieve with this piece of code :

Date={"$(=max(Date([Time Full Date],'MM/DD/YYYY'))-30)"}

Anonymous
Not applicable
Author

Hi,

I am getting '0' for all dates. Actually before Include [Time Full Date]={"$(=max(Date([Time Full Date],'MM/DD/YYYY'))-30)"} this one in my set analysis. I used to get values. After including this I am getting 0's

Before

=count(DISTINCT{$<[Site Visit Hit Source]={"<>5,7,8,9"}, [Site Visit Post Page Event] = {0},[Time Full Date]={"$(=max(Date([Time Full Date],'MM/DD/YYYY'))-30)"}>} [Visitor ID])

After

Pls help me why it is behaving like this.

Regards,

Kumar

Not applicable
Author

Hi Try This


set vmaxdate= max(date([TimeFulldate]))

set vdate1=  addmonths($(vmaxdate),-1)


=count(DISTINCT{$<[Site Visit Hit Source]-={"5,7,8,9"}, [Site Visit Post Page Event] = {0}, Date={"$(=max(Date([Time Full Date],'MM/DD/YYYY'))-30)"}>} [Visitor ID])

or


count(DISTINCT{$<[Site Visit Hit Source]-={"5,7,8,9"}, [Site Visit Post Page Event] = {0}, Date={"$(vdate1)"}>} [Visitor ID])

Anonymous
Not applicable
Author

Hi,

Actually, I am trying to get last 31 days data from max(date). So i include [Time Full Date]={"$(=max(Date([Time Full Date],'MM/DD/YYYY'))-30)"} this one in my set analysis.

See original expression.

count(DISTINCT{$<[Site Visit Hit Source]={"<>5,7,8,9"}, [Site Visit Post Page Event] = {0},[Time Full Date]={"$(=max(Date([Time Full Date],'MM/DD/YYYY'))-30)"}>} [Visitor ID])

Regards,

Kumar

Anonymous
Not applicable
Author

your first part in Expression seems to be incorrect

see jonathans reply

what do you want achieve with: [Site Visit Hit Source]={"<>5,7,8,9"}

all except value 5,7,8,9? then use jonathans solution

sunny_talwar

Try this:

=Count(DISTINCT{$<[Site Visit Hit Source] -= {'5', '7' ,'8' ,'9'}, [Site Visit Post Page Event] = {0},[Time Full Date]={"$(=max(Date([Time Full Date],'MM/DD/YYYY'))-30)"}>} [Visitor ID])


=Count(DISTINCT{$<[Site Visit Hit Source] -= {'5', '7' ,'8' ,'9'}, [Site Visit Post Page Event] = {0},[Time Full Date]={"$(=Date(Max([Time Full Date]) - 30,'MM/DD/YYYY'))"}>} [Visitor ID])