Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Loop in Set Analysis to fetch selected value...

Hello Qlikers,

I am having a scenario which is like this...

I am having a TransactionDate Field which is used as a MasterCalender  and created one more field say TestDate which stores TransactionDate+1 logic...

Now If I selects multiple date from TransactionDate fields say, 04/Dec/2015, 06/Dec/2015, 10/Dec/2015

TestDate would return: 05/Dec/2015, 07/Dec/2015, 11/Dec/2015

Now I want to compare these TestDate with TransactionDate and want to fetch only matching data...

Here User can selects N values...So what I did, I used Concat(TestDate,'|') which is storing all selected date only..

How can I compare these Concatenated Date with TransactionDate in Set Analysis???

I thought of SubField(), Min(),Max() etc but they can fetch only one value at one time.

Can I use somthing like Looping at Set Analysis which will fetch ConcatenatedDate one by one & will be comparing those returned values with TransactionDate??

Any Range Function which can solve this issue?

Guys,

Gysbert Wassenaar

jagan mohan rao appala

swuehl

maxgro

tresesco

Sunny T

Marcus Sommer

Manish Kachhia

Please suggest..

Any help appreciated

1 Solution

Accepted Solutions
marcus_sommer

I'm not sure if I have understood your logic but you could try something like this:

sum({< TransactionDate = {"$(=chr(39) & concat(distinct date(TransactionDate+1, 'DD/MMM/YYYY'), chr(39) & ',' & chr(39)) & chr(39))"}>} Value)

- Marcus

View solution in original post

5 Replies
Gysbert_Wassenaar

Now I want to compare these TestDate with TransactionDate and want to fetch only matching data...

Can you explain that? If TestDate is always TransactionDate+1 these dates can never match.


talk is cheap, supply exceeds demand
marcus_sommer

I'm not sure if I have understood your logic but you could try something like this:

sum({< TransactionDate = {"$(=chr(39) & concat(distinct date(TransactionDate+1, 'DD/MMM/YYYY'), chr(39) & ',' & chr(39)) & chr(39))"}>} Value)

- Marcus

Anonymous
Not applicable
Author

I mean to say, If a User selects any TransactionDate, I should get the result of TransactionDate+1 values..It could be N values.


Am I clear?

PrashantSangle

Hi,

Not sure, but indirect set analysis will help you

just try

sum({<TransactionDate=p(TestDate)>}Value)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
sunny_talwar

If Marcus's provided solution doesn't work, I would try this without double quotes:

Sum({< TransactionDate = {$(=chr(39) & Concat(DISTINCT Date(TransactionDate+1, 'DD/MMM/YYYY'), chr(39) & ',' & chr(39)) & chr(39))}>} Value)