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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
gouthamkk
Creator
Creator

Set Analysis Expression

Hi Experts,

I am trying to get count of using below expression

count({<[Date Closed] > $(VInputDate)> , <Status={'Closed'}>, <Severity= {'High'}>} Status)

The above expression was working fine without the date comparison "[Date Closed] > $(VInputDate)"

Date Closed is the database filed which has random dates and VinputDate is a variable which changes dynamically. I know this is simple but am struggle to get the total count of the status which Vinputdate is < Date closed.

It would be great if some one could help

Thanks

Goutham

Message was edited by: Goutham Kandukuri

18 Replies
Anonymous
Not applicable

so what is the expression for your variable? sample data/file will help a lot.

gouthamkk
Creator
Creator
Author

Hi Michael,

I tried your expression, getting all 0 in the table

Not applicable

if VInputDate is variable then Remove = sign and use below

count({<[Date Closed] = {"> $(VInputDate)"} , Status={'Closed'}, Severity= {'High'} >} Status)

let see my expression which I am using in my application will help you

if(vFromDate >= Sdate1,sum({<T_Date= {'>=$(vFromDate) <=$(vToDate)'} >}Tday),0)

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

When doing date comparisons, the date format of the two expressions must be the same. How are you entering VInputdate? Check the format of [Date Closed] (easiest way - create a list box and scan through the values to confirm the format and that they are all formatted the same way. If you need to create a specific format:

count({<[Date Closed] = {"> $(=Date(VInputDate, 'DD-MM-YYYY'))"} , Status={'Closed'}, Severity= {'High'}} Status)


(this example assumes Date Closed is in DD-MM-YYYY format)


HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

You need to be very careful with matching date formats in Set Analysis, your VInputDate variable may need a Date function in it, eg:

=Date(today(), 'DD MMM YYYY')

Where the date format specifier exactly matches the natural format of the Date Closed field.  You could apply a Date function to your load script to ensure you know what the date format is of that field.

gouthamkk
Creator
Creator
Author

I did add sample data

gouthamkk
Creator
Creator
Author

Hi Steve,

I did check the format, as requested but i am still getting null values, FYI i did attach sample data

gouthamkk
Creator
Creator
Author

Hi Jonathan,

I did try, getting null values just in case, i attached sample data

Not applicable

See attached!

Vinay