Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
samuel_brierley
Creator
Creator

can someone please check my Syntax

Hi all,

Im convinced this is correct but obviously not lol

=count({<Clearance_Time = {$(>num(MonthEnd(Raised_Timestamp)))}>}Clearance_Time)

to check this Ive separated the parts out into the below table to help me work out the problem....didn't help

if its not obvious what i'm trying to do is count the occurrences where an item is cleared in the month after it was raised.

1 Solution

Accepted Solutions
Not applicable

Just change the expression as below.

count({$<Clearance_Time={">$(num(MonthEnd(Only(Raised_Timestamp))))"}>} Clearance_Time)

View solution in original post

6 Replies
marcus_malinow
Specialist III
Specialist III

Try this:

count({$<Clearance_Time={">$(=num(MonthEnd(Only(Raised_Timestamp))))"}>} Clearance_Time)

If you are not specifying a specific value for your Set Analysis, you need to use a search string (denoted by the set enclosed in double quotes, and the '>', so we are searching for values greater than the value within the set.

Also, you need some sort of aggregation for the set value - in this example i've used Only as I imaging their may be only one value of Raised_Timestamp for each Clearance_Time.

samuel_brierley
Creator
Creator
Author

Thanks for trying guys but neither of the above result in a number and from the Image you can see that this shouldn't be the case.

I've attached my qvw if that helps, sheet 3 contains the tables im looking at here.

I'm only a personal user so if you get to a solution please post it in as text

thanks for all the help guys

Gysbert_Wassenaar

Create a new field in the script in a preceding load that checks if the clearance time is larger than the monthend time of the raised time.

[Fault Table]:

LOAD *, If(Clearance_Time> MonthEnd( Raised_Date),1,0) as ClearedLate;

LOAD Fault_Id,

     Fault_State,

...etc

You can then use this new field in your count expression: count({<ClearedLate={1}>}Clearance_Time)


talk is cheap, supply exceeds demand
Not applicable

Just change the expression as below.

count({$<Clearance_Time={">$(num(MonthEnd(Only(Raised_Timestamp))))"}>} Clearance_Time)

View solution in original post

samuel_brierley
Creator
Creator
Author

Thanks,

I can now spend the time wrapping my head round why my way wouldn't work.

Gysbert_Wassenaar

That answer is not correct. It will return the same as count(Clearance_Time). You can see in the screenshot below how the dollar expansion is evaluated:

comm174636.png


talk is cheap, supply exceeds demand