Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
Not applicable

How can I set right expression?

Hi guys,

Tell me please, How can I set expression with an exeption parameter?

For example: I have 3000 location, but 1700 is active and I need them.

Attribute: is location doesn't active "Pairing precession = -1"

This expression doesn't work:

( {<[Pairing precession]=[Pairing precession]-{'-1'}>} [Location])

Many thanks,

Yuriy

1 Solution

Accepted Solutions
Highlighted
vishsaggi
Esteemed Contributor III

Re: How can I set right expression?

You want this in the script or in the Front end?

Try like in your Straight table Dimension

= If([Pairing Precession] <> -1, [ID Location])

OR

= Aggr(Only({< [Pairing Precession] = {'<>1'}>}), [ID Location])

Then supress Null Values.

Expr:

= [Pairing Precession]

View solution in original post

9 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: How can I set right expression?

Pretty close. Something like this:

Count( {<[Pairing precession]= - {-1}>} [Location])


You need some sort of an Aggregation function (Count, Only, or anything else) in order to host your Set Analysis expression.


Cheers,

Oleg Troyansky

Upgrade your Qlik skills with my book QlikView Your Business: An Expert Guide to Business Discovery with QlikView and Qlik Sense

Highlighted
vishsaggi
Esteemed Contributor III

Re: How can I set right expression?

Not clear what you are trying to do. Can you elaborate and give us more info for below?

Attribute: is location doesn't active "Pairing precession = -1"

This expression doesn't work:

( {<[Pairing precession]=[Pairing precession]-{'-1'}>} [Location])


are you doing a set analysis with Pairing precession as -1.

May be you want to try like

= Sum( {< [Pairing precession] -= {'-1'} >} [Location])


Highlighted
Not applicable

Re: How can I set right expression?

Yes, of course. For example, I have:

ID location  Pairing Precession

18:00:00
214:00:00
313:00:00
411:00:00
512:00:00
6-1
711:00:00
811:00:00
911:00:00
10

-1

1111:00:00
12-1
1311:00:00
14-1

I want to see:

18:00:00
214:00:00
313:00:00
411:00:00
512:00:00
711:00:00
811:00:00
911:00:00
1111:00:00
1311:00:00

How can I do it? help me, please.

Many thanks,

Yuriy

Highlighted
Not applicable

Re: How can I set right expression?

Please, see below=)

Highlighted
kkkumar82
Valued Contributor III

Re: How can I set right expression?

if you have only one value for one ID then

Only({<Pairing Precession = Pairing Precession - {-1}>} Pairing Precession)

if your not successful then do this,

in your load script

Load

ID location  ,

Pairing Precession,

if(Pairing Precession = -1, 0,1) as Flag;


use this in set analysis


Only({<Flag-={0}>} Pairing Precession)

Highlighted
prachisangewar
Contributor

Re: How can I set right expression?

hi,

Attached is the solution.

Highlighted
vishsaggi
Esteemed Contributor III

Re: How can I set right expression?

You want this in the script or in the Front end?

Try like in your Straight table Dimension

= If([Pairing Precession] <> -1, [ID Location])

OR

= Aggr(Only({< [Pairing Precession] = {'<>1'}>}), [ID Location])

Then supress Null Values.

Expr:

= [Pairing Precession]

View solution in original post

Highlighted
Not applicable

Re: How can I set right expression?

Thanks all. It was very useful for me.

Highlighted

Re: How can I set right expression?

You can use simple any one of below

Only({<[Pairing Precession] -= {'-1'}>} [Pairing Precession])

or

Only({<[Pairing Precession] = E({<[Pairing Precession] = {'-1'}>}[Pairing Precession])>} [Pairing Precession])

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)