Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use of greater than sign at set analysis expression

Hi All,

I am having one intresting problem in set analysis expression,

where i am using condition like my Doc Recived Date should be greater than selected month ????

expression is like this ..

Count({$<YM={'$(vCurrentyearmonth)'},STATUS={'Deferred'},Year=,Quarter=,MonthName=>} distinct BTFILE_NO)

here i want to insert one more condition using greater than sign for date like if my( RMONTH > MONTHNAME ) THEN COUNT FUNCTION SHOULD WORK.....

Any Guess......

PLEASE FIND OUT THE APPLICATION ATTACHED FOR YOUR REFRENCE AND UNDERSTANDING.........

Please reply ASAP..... AS THIS IS VERY URGENT....

Regards,

Dushyant



12 Replies
fernandotoledo
Partner - Specialist
Partner - Specialist

I suggest you study the example below

http://community.qlik.com/media/p/82604.aspx

best regards,

fernando

Not applicable
Author

Fernando,

I dont think that doccument will help because i need to use greater than sign (FOR DATE COMPARISON) at expression level....

Regards,

Dushyant

jonathandienst
Partner - Champion III
Partner - Champion III

Dushyant

Something like this, perhaps:


Count({$<YM={'$(vCurrentyearmonth)'},STATUS={'Deferred'},Year=,Quarter=,MonthName=,RMONTH={">$(MONTHNAME)"}>} distinct BTFILE_NO)


... assuming that RMONTH is a field and MONTHNAME isa variable, and that RMONTH and MONTHNAME have the same textual format (if they are dates).

This won't work if MONTHNAME is a field - you need a unique value. This could be something like Min(MONTHNAME), as in ....

....,RMONTH={">$(=Date(Min(MONTHNAME)))"}... (again assuming RMONTH is a date in the default format).

Although I have to ask why you would want to do a > comparison on month name?

Hope this helps

Jonathan

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

You can use greater than like:

sum({$<Year={">2000"}>}


However, I think this won't work for a text value, you'd need to create another field in your script that puts the months into numerical order, so you could have for example:

Count({$<RmonthNumeric={">7"},YM={'$(vCurrentyearmonth)'},STATUS={'Deferred'},Year=,Quarter=,MonthName=>} distinct BTFILE_NO)


Hope it works out for you.

Dominic



Not applicable
Author

Well Thanx John,

But Can you have a look at document i attached with my post.You can see my script their and apply at my expression.I think u need to work a bit more on my document.

can you send me my modified document along with those changes u have made ....

Thanx in advance....

Waiting for your reply.....

Not applicable
Author

Dominic,

Thanks for your prompt respose ,

I think you hit on the right spot but my desired result is still pending.

Can you have a look at my document attached with my post.You can see my script their and apply at my expression.I think u need to work a bit more on my document.

can you send me my modified document along with those changes u have made ....

Thanx in advance....

Waiting for your reply.....

Regards,

Dushyant

Not applicable
Author

Dushyant

In your script you could maybe use a map load to apply a sequence to the month names like:

<table><tbody><tr><td>Map_Classification:</td></tr><tr><td>
</td><td>MAPPING</td></tr><tr><td>
</td><td>LOAD * INLINE [</td></tr><tr><td>
</td><td> RMonth, MthNumeric</td></tr><tr><td>
</td><td> Jan, 1</td></tr><tr><td>
</td><td> Feb, 2</td></tr><tr><td>
</td><td> Mar, 3</td></tr><tr><td>
</td><td> Apr, 4</td></tr><tr><td>
</td><td>];</td></tr><tr><td>
</td><td> </td></tr><tr><td>
</td><td>
//Load FirstTable

</td></tr><tr><td>
</td><td>SecondTable:</td></tr><tr><td>
</td><td>Load</td></tr><tr><td>
</td><td> Rmonth,</td></tr><tr><td>
</td><td> // Use the applymap to classify the RMonth, 999 is the default-value </td></tr><tr><td>
</td><td> // if the applymap does not find a match</td></tr><tr><td>
</td><td> applymap('Map_Classification',RMonth,999) as RMonthNumeric </td></tr><tr><td>
</td><td>RESIDENT FirstTable;</td></tr></tbody></table>
Obviously you need to amend this to match your table name, month names etc.

Hope this helps

Dominic

Not applicable
Author

Dominice,

Can you apply these changes to my script and send me back..because i dont know how to use apply map function.

Thanks in advance......

Waiting for your apply.....

Regards,

Dushyant

llauses243
Creator III
Creator III

Hi,

I'am thinking than the case is comparation 2 fields's date same table (RECEIVEDDATE (Rmonth) & FIRST_DISB_DATE (MONTHNAME))

then its my offer, see attached

good luck, Luis