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

list of single quotes string as single value

Hi

I want to apply an condition in following manner

If(condition match, " 'new','progress','working' ", 'Old')

Basically I want to use this string as value  'new','progress','working' . But in qlikview it is not working, Kindly suggest some alternative to do this.

Tribhuwan

8 Replies
Not applicable
Author

Hi,

Not able to understand could  you please explain me it properly.

Regards,

Nitin Jain

Not applicable
Author

Actually I want to use this list of value in my expression for comparison like

Match (Status, ’New’, ’Progress’, ’Work’) Further I want to replace this list (’New’, ’Progress’, ’Work’) as variable Match(Status,$(CurrentStatus))

And this Current Status can have following values

‘New’ or ‘New’,’Progress’ or ‘New’,’Progress’,’Work’

And this value is coming from a different variable where I want to customize it in following manner

If(id=1,(’New’))

If(id=2,(‘New’, ’Progress’))

If(id=3, (’New’, ’Progress’, ’Work’))

Thanks & Regards

Tribhuwan

whiteline
Master II

First of all, use right quotes ''. Second, with brackets you did not avoid symtax errors.

You have to put all condition strings (like: ‘New’, ’Progress’) into variables (I used exC0, exC1, exC2) without brackets.

Than put your formula into variable CurrentStatus (with leading =, it's important):

=If(id=1, exC0, If(id=2, exC1, If(id=3, exC2)))

The trick is that you let QlikView first evalueate your IF expression.

So you should use variables as is, without parsing $() and start expression with =.

Than you can use expressions in charts like =Match(Data, $(exCondition))

Depending on the value of ID the corresponding exCN name will be substituted instead of exCondition.

Not applicable
Author

Hi

Let me explain my problem here from scratch.

I have ids and following type of possible states New, Analyzing, Confirming, Verifying, Integrating in my data.

In my Qlikview application there is a field Status which may have values described above. I have two variables ‘start-date’ and ‘end-date’ in drop down.

There are some possible states for start-date and similarly for end-date.

Suppose list_start contains the states for start-date and list_end contains the list for end-date.

For e.g. suppose start-date = created date then list_start = (New, Analyzing, Confirming, Verifying )

and end-date = pending date then list_end = (Confirming, Verifying, Integrating)

Now I want to count those ids which have states common in both list (list_start and list_end) i.e. the count of ids having status =Confirming or Verifying.

PS: There are 10 possible values of start-date and end-date both.

What should be the right approach to do this in QV as it is very urgent. Kindly help.

Thanks & Regards

Tribhuwan

whiteline
Master II

It depends on what is "ids".

If it's some kind of simple state then you could assign numbers (craete another field) to them and do all calculations with numbers while let the user to select strings.

If it is a complex state concatenated into one string and the order of substates can be arbitrary then you could create some ID field to identify your essence that has dates and status. After that you could load all states as substates in a table with an  ID as key. So that you have to tables one with essences and one with its states.

Then you can count everything you want.

Not applicable
Author

Ids are integer and my data is like

Id Status

2 New

6 Analyzing

7 Confirming

10 Verifying

20 New

23 Analyzing

What should be the approach to count them on the basis of criteria that I discussed in previous reply. (counting the common states)

Thanks & Regards

Tribhuwan

Not applicable
Author

Suppose the result of first comparison for start-date gives this list (New, Confirming, Analyzing, Verifying)

And for end-date gives the list (Confirming, Verifying, Integrating)

Now I want the common states between this two list as my final value to use in my expression.

How to achieve this finding common states between this two lists i.e. (Confirming, Verifying)

Thanks & Regards

Tribhuwan

whiteline
Master II

Ok, you didn't answer how these statuses logically connected with your essense.

If you just want to count all statuses that are 'New' OR 'Verifying' you can use this expression:

= -Sum(Match(Status, 'New', 'Verifying')>0)